remove xpcom plugin api samples, sdk documentation updates, mac build updates. b=360955 rs=jst

This commit is contained in:
Josh Aas 2008-09-03 00:39:55 -04:00
Родитель b8a486d70c
Коммит 1175d4dbe2
37 изменённых файлов: 25 добавлений и 8440 удалений

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

@ -1,62 +1,17 @@
Last updated 12.20.2001
The current version of the Netscape Plugin API is designed to help
the developers to start creating plugins for Mozilla based browsers.
Last updated September 2008
This SDK is based on the API developed originally for Netscape browsers
starting with Netscape 2.x. Some additions have been made at the time
of release Netscape 3.x and Netscape 4.x. The present SDK reflects major
changes related to Mozilla code base: LiveConnect for plugin scriptability
is no longer supported, existing plugins should be modified slightly to
become scriptable again; the browser services are now accessible from
the plugin through the access to the service manager.
The SDK is intended to help in creating full-blown plugins to work with
Mozilla code base without actually having the whole Mozilla source tree
present and built.
starting with Netscape 2.x. It is intended to help in creating plugins
that will work with any modern NPAPI-compliant web browsers.
===============================================================
The Common folder contains stub implementations of the NPAPI methods, there
is no need to modify files in this folder, just include them into your project.
This is not necessary though, some samples or plugin projects may use
their own implementations, the files in this folder are just an illustration
of one possible way to do that.
Samples
The Samples section at this point contains the following plugin samples:
1. Basic plugin
Shows the bare bones of the plugin dll. It does not do anything special,
'Hello, World' type of thing. Demonstrates how the plugin dll is invoked
and how NPAPI methods are called. Can be used as a starting template for
writing your own plugin.
2. Simple plugin
This plugin example illustrates specific for Mozilla code base features.
It is scriptable via JavaScript and uses services provided by the browser.
Some xpcom interfaces are implemented here so the Mozilla browser is aware
of its capabilities. The plugin does not draw in the native window but
rather uses JavaScript box to display the result of its work. Therefore,
there are no separate projects for different platforms in this sample.
3. Scriptable plugin
Yet another example of plugin scriptability. This plugin implements two
native methods callable from the JavaScript and uses native window drawings.
4. Windowless plugin
Example of a plugin which does not use native window messaging mechanism
and relies exclusively on NPP_HandleEvent to receive GUI messages such
as for painting. This plugin simply draws gray rectangle in occupied area.
Scriptable samples require generation of .xpt files which should reside
in the Mozilla Components directory. To make sure Mozilla is aware of
the presence of the new .xpt file one may look at xpti.dat. To force
Mozilla to re-scan the Components directory xpti.dat should be removed
before Mozilla is started.
The "samples" directory contains NPAPI plugin samples. Within the "samples"
directory the common folder contains stub implementations of the NPAPI methods.
There is no need to modify files in this folder, just include them into your
project if you wish. Each sample plugin contains a readme file describing it.
===============================================================

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

@ -1,28 +0,0 @@
/*
acmeIScriptObject.idl
*/
#include "nsISupports.idl"
[scriptable, uuid(f78d64e0-1dd1-11b2-a9b4-ae998c529d3e)]
interface acmeIScriptObject : nsISupports {
acmeIScriptObject getProperty(in string name);
void setProperty(in string name, in string value);
/**
* Evaluates a string expression.
*/
acmeIScriptObject evaluate(in string expression);
/**
* Conversions.
*/
string toString();
double toNumber();
/**
* Constructors.
*/
acmeIScriptObject fromString(in string value);
acmeIScriptObject fromNumber(in double value);
};

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

@ -1,220 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.76 [en]C-AOLNSCP (Win98; U) [Netscape]">
<title>Scripting Old Style Plugins with Mozilla</title>
</head>
<body>
<center><b><font size=+2>Scripting Old Style Plugins in Mozilla</font></b>
<br><i>April 11, 2001</i>
<br>(see online version for the latest updates:
<a href="http://mozilla.org/docs/scripting-plugins.html">http://mozilla.org/docs/scripting-plugins.html</a>)
</center>
<p><a href="readme.html#introduction">Introduction</a>
<br><a href="readme.html#mozilla">New in Mozilla code</a>
<br><a href="readme.html#plugin">New in plugin code</a>
<br><a href="readme.html#script">JavaScript code</a>
<br><a href="readme.html#build">Building and installing the plugin</a>
<br><a href="readme.html#more">What else to read</a>
<br><a href="readme.html#example1">Examples</a>
<p><a NAME="introduction"></a><b>Introduction</b>
<p>Plugins that used to take advantage of being scriptable via LiveConnect
in 4.x Netscape browsers lost this possibility in the new world. The main
reason for this is that there is no guarantee of Java compatibility on
a binary level due to the jri/jni switch. The newly introduced <a href="http://www.mozilla.org/docs/plugin.html">Mozilla
Plugin API</a> allows plugins be scriptable via a different mechanism called
<a href="http://www.mozilla.org/scriptable/index.html">XPConnect.</a>&nbsp;
Basically, this means that in order to use and take full advantage of this
new API, which is interface-based,&nbsp; and to be scriptable, plugins
must be rewritten to become <a href="http://www.mozilla.org/projects/xpcom/">XPCOM</a>
components. Switching to the new world may not be immediately desirable
by some plugin makers, since the task involves a fair amount of effort,
and if the plugin mostly works fine lacking only scriptability, developers
will probably just give up on this feature, which may result in unpleasant
experience for the end user.
<p>In order to make the transtion smoother, some changes have been made
to the Mozilla code. The changes allow to make existing 4.x plugins scriptable
with only minor modifications in their code. The present document describes
the steps of what should be done to the plugin code to turn it scriptable
again.
<p><a NAME="mozilla"></a><b>What's in the Mozilla code?</b>
<p>A couple of lines have been added to the DOM code asking a plugin to
return a scriptable iid and a pointer to a scriptable instance object.
The old Plugin API call <tt>NPP_GetValue</tt> is used to retrieve this
information from the plugin. So the plugin project should be aware of two
new additions to <tt>NPPVariable</tt> enumeration type which are now defined
in npapi.h as
<p><tt>&nbsp; NPPVpluginScriptableInstance = 10,</tt>
<br><tt>&nbsp; NPPVpluginScriptableIID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
11</tt>
<p>and two analogous additions to nsPluginInstanceVariable type in nsplugindefs.h
as
<p><tt>&nbsp; nsPluginInstanceVariable_ScriptableInstance = 10,</tt>
<br><tt>&nbsp; nsPluginInstanceVariable_ScriptableIID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= 11</tt>
<p><a NAME="plugin"></a><b>What's in the plugin code?</b>
<p>1. A unique interface id should be obtained. Windows command <tt>uuidgen</tt>
should be sufficient.
<p>2. An Interface Definition (<tt>.idl</tt>) file describing the plugin
scriptable interface should be added to the project (<a href="#example1">see
example 1</a>).
<p>3. A Scriptable instance object should be implemented in the plugin.
This class will contain native methods callable from JavaScript. This class
should also inherit from nsISecurityCheckedComponent and implement its
methods to be able to request all necessary privileges from the Mozilla
security manager (<a href="#example2">see example 2</a>).
<p>4. Two new cases for the above mentioned new variables should be added
to the plugin implementation of <tt>NPP_GetValue</tt> (<a href="#example3">see
example 3</a>).
<p><a NAME="script"></a><b>How to call plugin native methods</b>
<p>The following HTML code will do the job:
<p><tt>&lt;embed type="application/plugin-mimetype"></tt>
<br><tt>&lt;script></tt>
<br><tt>var embed = document.embeds[0];</tt>
<br><tt>embed.nativeMethod();</tt>
<br><tt>&lt;/script></tt>
<p><a NAME="build"></a><b>How to build and install</b>
<p>Having the built Mozilla tree is probably not necessary, but building
the plugin with a scriptable instance interface will require Mozilla headers
and the XPCOM compatible idl compiler -- xpidl.exe. <i>MS DevStudio MIDL
should not be used</i>. (Let's assume 'TestPlugin' as a plugin name-place
holder.)
<p>1. Compile nsITestPlugin.idl with the idl compiler. This will generate
nsITestPlugin.h and nsITestPlugin.xpt files.
<p>2. Put nsITestPlugin.xpt to the Components folder.
<p>3. Build nptestplugin.dll with nsITestPlugin.h included for compiling
scriptable instance class implementaion.
<p>4. Put nptestplugin.dll to the Plugins folder.
<p><a NAME="more"></a><b>Related sources</b>
<br>&nbsp;
<ul>
<li>
<a href="http://bugzilla.mozilla.org/">http://bugzilla.mozilla.org</a>
has two bugs in its database which are related to this topic: <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=73856">73856
</a>and <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=73874">73874</a>.
The latter contains the full sample plugin code.</li>
<li>
IBM Developer Works has published <a href="http://www-106.ibm.com/developerworks/components/library/co-xpcom.html">a
good article on XPCOM.</a></li>
</ul>
<p><a NAME="example1"></a><b>Example 1. Sample .idl file</b>
<p><tt>#include "nsISupports.idl"</tt>
<p><tt>[scriptable, uuid(bedb0778-2ee0-11d5-9cf8-0060b0fbd8ac)]</tt>
<br><tt>interface nsITestPlugin : nsISupports {</tt>
<br><tt>&nbsp; void nativeMethod();</tt>
<br><tt>};</tt>
<p><a NAME="example2"></a><b>Example 2. Scriptable instance class</b>
<p><tt>#include "nsITestPlugin.h"</tt>
<br><tt>#include "nsISecurityCheckedComponent.h"</tt>
<p><tt>class nsScriptablePeer : public nsITestPlugin,</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
public nsISecurityCheckedComponent</tt>
<br><tt>{</tt>
<br><tt>public:</tt>
<br><tt>&nbsp; nsScriptablePeer();</tt>
<br><tt>&nbsp; ~nsScriptablePeer();</tt>
<p><tt>&nbsp; NS_DECL_ISUPPORTS</tt>
<br><tt>&nbsp; NS_DECL_NSITESTPLUGIN</tt>
<br><tt>&nbsp; NS_DECL_NSISECURITYCHECKEDCOMPONENT</tt>
<br><tt>};</tt>
<p><tt>nsScriptablePeer::nsScriptablePeer()</tt>
<br><tt>{</tt>
<br><tt>&nbsp; NS_INIT_ISUPPORTS();</tt>
<br><tt>}</tt>
<p><tt>nsScriptablePeer::~nsScriptablePeer()</tt>
<br><tt>{</tt>
<br><tt>}</tt>
<p><tt>NS_IMPL_ISUPPORTS2(nsScriptablePeer, nsITestPlugin, nsISecurityCheckedComponent)</tt>
<p><tt>// the following method will be callable from JavaScript</tt>
<br><tt>NS_IMETHODIMP nsScriptablePeer::NativeMethod()</tt>
<br><tt>{</tt>
<br><tt>&nbsp; return NS_OK;</tt>
<br><tt>}</tt>
<p><tt>// the purpose of the rest of the code is to get successfully</tt>
<br><tt>// through the Mozilla Security Manager</tt>
<br><tt>static const char gAllAccess[] = "AllAccess";</tt>
<br><tt>NS_IMETHODIMP nsScriptablePeer::CanCreateWrapper(const nsIID *
iid, char **_retval)</tt>
<br><tt>{</tt>
<br><tt>&nbsp; if (!_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_NULL_POINTER;</tt>
<br><tt>&nbsp; *_retval = (char*)NPN_MemAlloc(sizeof(gAllAccess)+1);</tt>
<br><tt>&nbsp; if (!*_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_OUT_OF_MEMORY;</tt>
<br><tt>&nbsp; strcpy(*_retval, gAllAccess);</tt>
<br><tt>&nbsp; return NS_OK;</tt>
<br><tt>}</tt>
<p><tt>NS_IMETHODIMP nsScriptablePeer::CanCallMethod(const nsIID * iid,
const PRUnichar *methodName, char **_retval)</tt>
<br><tt>{</tt>
<br><tt>&nbsp; if (!_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_NULL_POINTER;</tt>
<br><tt>&nbsp; *_retval = (char*)NPN_MemAlloc(sizeof(gAllAccess)+1);</tt>
<br><tt>&nbsp; if (!*_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_OUT_OF_MEMORY;</tt>
<br><tt>&nbsp; strcpy(*_retval, gAllAccess);</tt>
<br><tt>&nbsp; return NS_OK;</tt>
<br><tt>}</tt>
<p><tt>NS_IMETHODIMP nsScriptablePeer::CanGetProperty(const nsIID * iid,
const PRUnichar *propertyName, char **_retval)</tt>
<br><tt>{</tt>
<br><tt>&nbsp; if (!_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_NULL_POINTER;</tt>
<br><tt>&nbsp; *_retval = (char*)NPN_MemAlloc(sizeof(gAllAccess)+1);</tt>
<br><tt>&nbsp; if (!*_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_OUT_OF_MEMORY;</tt>
<br><tt>&nbsp; strcpy(*_retval, gAllAccess);</tt>
<br><tt>&nbsp; return NS_OK;</tt>
<br><tt>}</tt>
<p><tt>NS_IMETHODIMP nsScriptablePeer::CanSetProperty(const nsIID * iid,
const PRUnichar *propertyName, char **_retval)</tt>
<br><tt>{</tt>
<br><tt>&nbsp; if (!_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_NULL_POINTER;</tt>
<br><tt>&nbsp; *_retval = (char*)NPN_MemAlloc(sizeof(gAllAccess)+1);</tt>
<br><tt>&nbsp; if (!*_retval)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NS_ERROR_OUT_OF_MEMORY;</tt>
<br><tt>&nbsp; strcpy(*_retval, gAllAccess);</tt>
<br><tt>&nbsp; return NS_OK;</tt>
<br><tt>}</tt>
<p><a NAME="example3"></a><b>Example 3. NPP_GetValue implementation</b>
<p><tt>#include "nsITestPlugin.h"</tt>
<p><tt>NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)</tt>
<br><tt>{</tt>
<br><tt>&nbsp; if(instance == NULL)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; return NPERR_INVALID_INSTANCE_ERROR;</tt>
<p><tt>&nbsp; NPError rv = NPERR_NO_ERROR;</tt>
<br><tt>&nbsp; static nsIID scriptableIID = NS_ITESTPLUGIN_IID;</tt>
<p><tt>&nbsp; if (variable == NPPVpluginScriptableInstance)</tt>
<br><tt>&nbsp; {</tt>
<br><tt>&nbsp;&nbsp;&nbsp; if (this is first time and we haven't created
it yet)</tt>
<br><tt>&nbsp;&nbsp;&nbsp; {</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nsITestPlugin * scriptablePeer =
new nsScriptablePeer();</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(scriptablePeer)</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // addref for ourself,
don't forget to release on shutdown to trigger its destruction</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS_ADDREF(scriptablePeer);</tt>
<br><tt>&nbsp;&nbsp;&nbsp; }</tt>
<br><tt>&nbsp;&nbsp;&nbsp; // add reference for the caller requesting the
object</tt>
<br><tt>&nbsp;&nbsp;&nbsp; NS_ADDREF(scriptablePeer);</tt>
<br><tt>&nbsp;&nbsp; *(nsISupports **)value = scriptablePeer;</tt>
<br><tt>&nbsp; }</tt>
<br><tt>&nbsp; else if (variable == NPPVpluginScriptableIID)</tt>
<br><tt>&nbsp; {</tt>
<br><tt>&nbsp;&nbsp;&nbsp; nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID));</tt>
<br><tt>&nbsp;&nbsp;&nbsp; *ptr = scriptableIID;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; *(nsIID **)value = ptr;</tt>
<br><tt>&nbsp; }</tt>
<br><tt>&nbsp; return rv;</tt>
<br><tt>}</tt>
<br>&nbsp;
</body>
</html>

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

@ -1,77 +0,0 @@
#!gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org Code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ..\..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = np4xscr
XPIDLSRCS = \
.\nsI4xScriptablePlugin.idl \
$(NULL)
MAKE_OBJ_TYPE = DLL
DLLNAME = np4xscr
RESFILE = np4xscr.res
DEFFILE = np4xscr.def
DLL=.\$(OBJDIR)\$(DLLNAME).dll
OBJS = \
.\$(OBJDIR)\np_entry.obj \
.\$(OBJDIR)\npn_gate.obj \
.\$(OBJDIR)\npp_gate.obj \
.\$(OBJDIR)\plugin.obj \
.\$(OBJDIR)\nsScriptablePeer.obj \
$(NULL)
WIN_LIBS = version.lib
#uncomment if you are building the nsScriptablePeer1 version
#LLIBS= $(LIBNSPR) \
# $(DIST)\lib\xpcom.lib \
# $(NULL)
include <$(DEPTH)/config/rules.mak>
#MAKE_INSTALL=echo $(MAKE_INSTALL)
libs:: $(DLL)
# $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\plugins
clobber::
rm -f *.sbr $(DIST)\bin\plugins\$(DLLNAME).dll $(DIST)\bin\components\$(DLLNAME).xpt

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

@ -1,6 +0,0 @@
LIBRARY NP4XSCR
EXPORTS
NP_GetEntryPoints @1
NP_Initialize @2
NP_Shutdown @3

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

@ -1,112 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", " \0"
VALUE "FileDescription", "np4xscr\0"
VALUE "FileExtents", "4sc\0"
VALUE "FileOpenName", "np4xscr\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "np4xscr\0"
VALUE "LegalCopyright", "Copyright © 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "MIMEType", "application/mozilla-4x-scriptable-plugin\0"
VALUE "OriginalFilename", "ns4xscr.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "4x scriptable example plugin for Mozilla\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // !_MAC
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -1,119 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//////////////////////////////////////////////////////////////
//
// Main plugin entry point implementation
//
#include "npapi.h"
#include "npupp.h"
NPNetscapeFuncs NPNFuncs;
#ifdef XP_WIN
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs)
{
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if(pFuncs->size < sizeof(NPPluginFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR;
pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pFuncs->newp = NPP_New;
pFuncs->destroy = NPP_Destroy;
pFuncs->setwindow = NPP_SetWindow;
pFuncs->newstream = NPP_NewStream;
pFuncs->destroystream = NPP_DestroyStream;
pFuncs->asfile = NPP_StreamAsFile;
pFuncs->writeready = NPP_WriteReady;
pFuncs->write = NPP_Write;
pFuncs->print = NPP_Print;
pFuncs->event = NPP_HandleEvent;
pFuncs->urlnotify = NPP_URLNotify;
pFuncs->getvalue = NPP_GetValue;
pFuncs->setvalue = NPP_SetValue;
pFuncs->javaClass = NULL;
return NPERR_NO_ERROR;
}
#endif /* XP_WIN */
NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs)
{
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
if(pFuncs->size < sizeof NPNetscapeFuncs)
return NPERR_INVALID_FUNCTABLE_ERROR;
NPNFuncs.size = pFuncs->size;
NPNFuncs.version = pFuncs->version;
NPNFuncs.geturlnotify = pFuncs->geturlnotify;
NPNFuncs.geturl = pFuncs->geturl;
NPNFuncs.posturlnotify = pFuncs->posturlnotify;
NPNFuncs.posturl = pFuncs->posturl;
NPNFuncs.requestread = pFuncs->requestread;
NPNFuncs.newstream = pFuncs->newstream;
NPNFuncs.write = pFuncs->write;
NPNFuncs.destroystream = pFuncs->destroystream;
NPNFuncs.status = pFuncs->status;
NPNFuncs.uagent = pFuncs->uagent;
NPNFuncs.memalloc = pFuncs->memalloc;
NPNFuncs.memfree = pFuncs->memfree;
NPNFuncs.memflush = pFuncs->memflush;
NPNFuncs.reloadplugins = pFuncs->reloadplugins;
NPNFuncs.getJavaEnv = NULL;
NPNFuncs.getJavaPeer = NULL;
NPNFuncs.getvalue = pFuncs->getvalue;
NPNFuncs.setvalue = pFuncs->setvalue;
NPNFuncs.invalidaterect = pFuncs->invalidaterect;
NPNFuncs.invalidateregion = pFuncs->invalidateregion;
NPNFuncs.forceredraw = pFuncs->forceredraw;
return NPERR_NO_ERROR;
}
NPError OSCALL NP_Shutdown()
{
return NPERR_NO_ERROR;
}

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

@ -1,705 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// npmac.cpp
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#include <Processes.h>
#include <Gestalt.h>
#include <CodeFragments.h>
#include <Timer.h>
#include <Resources.h>
#include <ToolUtils.h>
#define XP_MAC 1
#define NDEBUG 1
//
// A4Stuff.h contains the definition of EnterCodeResource and
// EnterCodeResource, used for setting up the code resource¹s
// globals for 68K (analagous to the function SetCurrentA5
// defined by the toolbox).
//
#if TARGET_CPU_68K
#include <A4Stuff.h>
#else
#define EnterCodeResource()
#define ExitCodeResource()
#endif
#include "npapi.h"
//
// The Mixed Mode procInfos defined in npupp.h assume Think C-
// style calling conventions. These conventions are used by
// Metrowerks with the exception of pointer return types, which
// in Metrowerks 68K are returned in A0, instead of the standard
// D0. Thus, since NPN_MemAlloc and NPN_UserAgent return pointers,
// Mixed Mode will return the values to a 68K plugin in D0, but
// a 68K plugin compiled by Metrowerks will expect the result in
// A0. The following pragma forces Metrowerks to use D0 instead.
//
#ifdef __MWERKS__
#ifndef powerc
#pragma pointers_in_D0
#endif
#endif
#include "npupp.h"
#ifdef __MWERKS__
#ifndef powerc
#pragma pointers_in_A0
#endif
#endif
// The following fix for static initializers (which fixes a preious
// incompatibility with some parts of PowerPlant, was submitted by
// Jan Ulbrich.
#ifdef __MWERKS__
#ifdef __cplusplus
extern "C" {
#endif
#ifndef powerc
extern void __InitCode__(void);
#else
extern void __sinit(void);
#define __InitCode__ __sinit
#endif
extern void __destroy_global_chain(void);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __MWERKS__
//
// Define PLUGIN_TRACE to 1 to have the wrapper functions emit
// DebugStr messages whenever they are called.
//
#define PLUGIN_TRACE 0
#if PLUGIN_TRACE
#define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
#else
#define PLUGINDEBUGSTR
#endif
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Globals
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#if !TARGET_API_MAC_CARBON
QDGlobals* gQDPtr; // Pointer to Netscape's QuickDraw globals
#endif
short gResFile; // Refnum of the plugin's resource file
NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Wrapper functions for all calls from the plugin to Netscape.
// These functions let the plugin developer just call the APIs
// as documented and defined in npapi.h, without needing to know
// about the function table and call macros in npupp.h.
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = gNetscapeFuncs.version >> 8; // Major version is in high byte
*netscape_minor = gNetscapeFuncs.version & 0xFF; // Minor version is in low byte
}
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
err = CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_GetURL(NPP instance, const char* url, const char* window)
{
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
err = CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, instance, url,
window, len, buf, file, notifyData);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
{
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, url, window, len, buf, file);
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, stream, rangeList);
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* window, NPStream** stream)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, type, window, stream);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_WriteProc(gNetscapeFuncs.write, instance, stream, len, buffer);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, instance, stream, reason);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
void NPN_Status(NPP instance, const char* message)
{
CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
}
const char* NPN_UserAgent(NPP instance)
{
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
}
#define DEBUG_MEMORY 0
void* NPN_MemAlloc(uint32 size)
{
#if DEBUG_MEMORY
return (void*) NewPtrClear(size);
#else
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
#endif
}
void NPN_MemFree(void* ptr)
{
#if DEBUG_MEMORY
DisposePtr(Ptr(ptr));
#else
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
#endif
}
uint32 NPN_MemFlush(uint32 size)
{
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
return CallNPN_GetValueProc( gNetscapeFuncs.getvalue, instance, variable, value);
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
return CallNPN_SetValueProc( gNetscapeFuncs.setvalue, instance, variable, value);
}
void NPN_InvalidateRect(NPP instance, NPRect *rect)
{
CallNPN_InvalidateRectProc( gNetscapeFuncs.invalidaterect, instance, rect);
}
void NPN_InvalidateRegion(NPP instance, NPRegion region)
{
CallNPN_InvalidateRegionProc( gNetscapeFuncs.invalidateregion, instance, region);
}
void NPN_ForceRedraw(NPP instance)
{
CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance);
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Wrapper functions for all calls from Netscape to the plugin.
// These functions let the plugin developer just create the APIs
// as documented and defined in npapi.h, without needing to
// install those functions in the function table or worry about
// setting up globals for 68K plugins.
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
NPError Private_Initialize(void);
void Private_Shutdown(void);
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
NPError Private_Destroy(NPP instance, NPSavedData** save);
NPError Private_SetWindow(NPP instance, NPWindow* window);
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
int32 Private_WriteReady(NPP instance, NPStream* stream);
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
void Private_Print(NPP instance, NPPrint* platformPrint);
int16 Private_HandleEvent(NPP instance, void* event);
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
NPError Private_GetValue(NPP instance, NPPVariable variable, void *result);
NPError Private_SetValue(NPP instance, NPNVariable variable, void *value);
NPError Private_Initialize(void)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pInitialize;g;");
err = NPP_Initialize();
ExitCodeResource();
return err;
}
void Private_Shutdown(void)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pShutdown;g;");
NPP_Shutdown();
__destroy_global_chain();
ExitCodeResource();
}
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
{
EnterCodeResource();
NPError ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
PLUGINDEBUGSTR("\pNew;g;");
ExitCodeResource();
return ret;
}
NPError Private_Destroy(NPP instance, NPSavedData** save)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pDestroy;g;");
err = NPP_Destroy(instance, save);
ExitCodeResource();
return err;
}
NPError Private_SetWindow(NPP instance, NPWindow* window)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pSetWindow;g;");
err = NPP_SetWindow(instance, window);
ExitCodeResource();
return err;
}
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pNewStream;g;");
err = NPP_NewStream(instance, type, stream, seekable, stype);
ExitCodeResource();
return err;
}
int32 Private_WriteReady(NPP instance, NPStream* stream)
{
int32 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pWriteReady;g;");
result = NPP_WriteReady(instance, stream);
ExitCodeResource();
return result;
}
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
{
int32 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pWrite;g;");
result = NPP_Write(instance, stream, offset, len, buffer);
ExitCodeResource();
return result;
}
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pStreamAsFile;g;");
NPP_StreamAsFile(instance, stream, fname);
ExitCodeResource();
}
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pDestroyStream;g;");
err = NPP_DestroyStream(instance, stream, reason);
ExitCodeResource();
return err;
}
int16 Private_HandleEvent(NPP instance, void* event)
{
int16 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pHandleEvent;g;");
result = NPP_HandleEvent(instance, event);
ExitCodeResource();
return result;
}
void Private_Print(NPP instance, NPPrint* platformPrint)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pPrint;g;");
NPP_Print(instance, platformPrint);
ExitCodeResource();
}
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pURLNotify;g;");
NPP_URLNotify(instance, url, reason, notifyData);
ExitCodeResource();
}
NPError Private_GetValue(NPP instance, NPPVariable variable, void *result)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pGetValue;g;");
err = NPP_GetValue(instance, variable, result);
ExitCodeResource();
return err;
}
NPError Private_SetValue(NPP instance, NPNVariable variable, void *value)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pSetValue;g;");
err = NPP_SetValue(instance, variable, value);
ExitCodeResource();
return err;
}
void SetUpQD(void);
void SetUpQD(void)
{
ProcessSerialNumber PSN;
FSSpec myFSSpec;
Str63 name;
ProcessInfoRec infoRec;
OSErr result = noErr;
CFragConnectionID connID;
Str255 errName;
//
// Memorize the plugin¹s resource file
// refnum for later use.
//
gResFile = CurResFile();
#if !TARGET_API_MAC_CARBON
//
// Ask the system if CFM is available.
//
long response;
OSErr err = Gestalt(gestaltCFMAttr, &response);
Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
if (hasCFM)
{
//
// GetProcessInformation takes a process serial number and
// will give us back the name and FSSpec of the application.
// See the Process Manager in IM.
//
infoRec.processInfoLength = sizeof(ProcessInfoRec);
infoRec.processName = name;
infoRec.processAppSpec = &myFSSpec;
PSN.highLongOfPSN = 0;
PSN.lowLongOfPSN = kCurrentProcess;
result = GetProcessInformation(&PSN, &infoRec);
if (result != noErr)
PLUGINDEBUGSTR("\pFailed in GetProcessInformation");
}
else
//
// If no CFM installed, assume it must be a 68K app.
//
result = -1;
if (result == noErr)
{
//
// Now that we know the app name and FSSpec, we can call GetDiskFragment
// to get a connID to use in a subsequent call to FindSymbol (it will also
// return the address of ³main² in app, which we ignore). If GetDiskFragment
// returns an error, we assume the app must be 68K.
//
Ptr mainAddr;
result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName,
kReferenceCFrag, &connID, (Ptr*)&mainAddr, errName);
}
if (result == noErr)
{
//
// The app is a PPC code fragment, so call FindSymbol
// to get the exported ³qd² symbol so we can access its
// QuickDraw globals.
//
CFragSymbolClass symClass;
result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
if (result != noErr)
PLUGINDEBUGSTR("\pFailed in FindSymbol qd");
}
else
{
//
// The app is 68K, so use its A5 to compute the address
// of its QuickDraw globals.
//
gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr)));
}
#endif /* !TARGET_API_MAC_CARBON */
}
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#pragma export on
#if !TARGET_API_MAC_CARBON
RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main);
#endif
#pragma export off
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pmain");
NPError err = NPERR_NO_ERROR;
//
// Ensure that everything Netscape passed us is valid!
//
if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == NULL))
err = NPERR_INVALID_FUNCTABLE_ERROR;
//
// Check the ³major² version passed in Netscape¹s function table.
// We won¹t load if the major version is newer than what we expect.
// Also check that the function tables passed in are big enough for
// all the functions we need (they could be bigger, if Netscape added
// new APIs, but that¹s OK with us -- we¹ll just ignore them).
//
if (err == NPERR_NO_ERROR)
{
if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
// if (nsTable->size < sizeof(NPNetscapeFuncs))
// err = NPERR_INVALID_FUNCTABLE_ERROR;
// if (pluginFuncs->size < sizeof(NPPluginFuncs))
// err = NPERR_INVALID_FUNCTABLE_ERROR;
}
if (err == NPERR_NO_ERROR)
{
//
// Copy all the fields of Netscape¹s function table into our
// copy so we can call back into Netscape later. Note that
// we need to copy the fields one by one, rather than assigning
// the whole structure, because the Netscape function table
// could actually be bigger than what we expect.
//
int navMinorVers = nsTable->version & 0xFF;
gNetscapeFuncs.version = nsTable->version;
gNetscapeFuncs.size = nsTable->size;
gNetscapeFuncs.posturl = nsTable->posturl;
gNetscapeFuncs.geturl = nsTable->geturl;
gNetscapeFuncs.requestread = nsTable->requestread;
gNetscapeFuncs.newstream = nsTable->newstream;
gNetscapeFuncs.write = nsTable->write;
gNetscapeFuncs.destroystream = nsTable->destroystream;
gNetscapeFuncs.status = nsTable->status;
gNetscapeFuncs.uagent = nsTable->uagent;
gNetscapeFuncs.memalloc = nsTable->memalloc;
gNetscapeFuncs.memfree = nsTable->memfree;
gNetscapeFuncs.memflush = nsTable->memflush;
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins;
if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{
gNetscapeFuncs.getJavaEnv = NULL;
gNetscapeFuncs.getJavaPeer = NULL;
}
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
gNetscapeFuncs.geturlnotify = nsTable->geturlnotify;
gNetscapeFuncs.posturlnotify = nsTable->posturlnotify;
}
gNetscapeFuncs.getvalue = nsTable->getvalue;
gNetscapeFuncs.setvalue = nsTable->setvalue;
gNetscapeFuncs.invalidaterect = nsTable->invalidaterect;
gNetscapeFuncs.invalidateregion = nsTable->invalidateregion;
gNetscapeFuncs.forceredraw = nsTable->forceredraw;
// defer static constructors until the global functions are initialized.
__InitCode__();
//
// Set up the plugin function table that Netscape will use to
// call us. Netscape needs to know about our version and size
// and have a UniversalProcPointer for every function we implement.
//
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
pluginFuncs->size = sizeof(NPPluginFuncs);
pluginFuncs->newp = NewNPP_NewProc(Private_New);
pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream);
pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile);
pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
pluginFuncs->write = NewNPP_WriteProc(Private_Write);
pluginFuncs->print = NewNPP_PrintProc(Private_Print);
pluginFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent);
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
}
if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{
pluginFuncs->javaClass = NULL;
pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue);
pluginFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue);
}
*unloadUpp = NewNPP_ShutdownProc(Private_Shutdown);
SetUpQD();
err = Private_Initialize();
}
ExitCodeResource();
return err;
}

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

@ -1,199 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////
//
// Implementation of Netscape entry points (NPN_*)
//
#include "npapi.h"
#include "npupp.h"
extern NPNetscapeFuncs NPNFuncs;
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = HIBYTE(NPNFuncs.version);
*netscape_minor = LOBYTE(NPNFuncs.version);
}
NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = NPNFuncs.geturlnotify(instance, url, target, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
NPError rv = NPNFuncs.geturl(instance, url, target);
return rv;
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = NPNFuncs.posturlnotify(instance, url, window, len, buf, file, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
{
NPError rv = NPNFuncs.posturl(instance, url, window, len, buf, file);
return rv;
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
NPError rv = NPNFuncs.requestread(stream, rangeList);
return rv;
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.newstream(instance, type, target, stream);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
int32 rv = 0;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.write(instance, stream, len, buffer);
else
rv = -1;
return rv;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = NPNFuncs.destroystream(instance, stream, reason);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
void NPN_Status(NPP instance, const char *message)
{
NPNFuncs.status(instance, message);
}
const char* NPN_UserAgent(NPP instance)
{
const char * rv = NULL;
rv = NPNFuncs.uagent(instance);
return rv;
}
void* NPN_MemAlloc(uint32 size)
{
void * rv = NULL;
rv = NPNFuncs.memalloc(size);
return rv;
}
void NPN_MemFree(void* ptr)
{
NPNFuncs.memfree(ptr);
}
uint32 NPN_MemFlush(uint32 size)
{
uint32 rv = NPNFuncs.memflush(size);
return rv;
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
NPNFuncs.reloadplugins(reloadPages);
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
NPError rv = NPNFuncs.getvalue(instance, variable, value);
return rv;
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
NPError rv = NPNFuncs.setvalue(instance, variable, value);
return rv;
}
void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
{
NPNFuncs.invalidaterect(instance, invalidRect);
}
void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{
NPNFuncs.invalidateregion(instance, invalidRegion);
}
void NPN_ForceRedraw(NPP instance)
{
NPNFuncs.forceredraw(instance);
}

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

@ -1,260 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////
//
// Implementation of plugin entry points (NPP_*)
// most are just empty stubs for this particular plugin
//
#include "plugin.h"
NPError NPP_Initialize(void)
{
return NPERR_NO_ERROR;
}
void NPP_Shutdown(void)
{
}
// here the plugin creates an instance of our CPlugin object which
// will be associated with this newly created plugin instance and
// will do all the necessary job
NPError NPP_New(NPMIMEType pluginType,
NPP instance,
uint16 mode,
int16 argc,
char* argn[],
char* argv[],
NPSavedData* saved)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
CPlugin * pPlugin = new CPlugin(instance);
if(pPlugin == NULL)
return NPERR_OUT_OF_MEMORY_ERROR;
instance->pdata = (void *)pPlugin;
return rv;
}
// here is the place to clean up and destroy the CPlugin object
NPError NPP_Destroy (NPP instance, NPSavedData** save)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
CPlugin * pPlugin = (CPlugin *)instance->pdata;
if(pPlugin != NULL) {
pPlugin->shut();
delete pPlugin;
}
return rv;
}
// during this call we know when the plugin window is ready or
// is about to be destroyed so we can do some gui specific
// initialization and shutdown
NPError NPP_SetWindow (NPP instance, NPWindow* pNPWindow)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
if(pNPWindow == NULL)
return NPERR_GENERIC_ERROR;
CPlugin * pPlugin = (CPlugin *)instance->pdata;
if(pPlugin == NULL)
return NPERR_GENERIC_ERROR;
// window just created
if(!pPlugin->isInitialized() && (pNPWindow->window != NULL)) {
if(!pPlugin->init(pNPWindow)) {
delete pPlugin;
pPlugin = NULL;
return NPERR_MODULE_LOAD_FAILED_ERROR;
}
}
// window goes away
if((pNPWindow->window == NULL) && pPlugin->isInitialized())
return NPERR_NO_ERROR;
// window resized
if(pPlugin->isInitialized() && (pNPWindow->window != NULL))
return NPERR_NO_ERROR;
// this should not happen, nothing to do
if((pNPWindow->window == NULL) && !pPlugin->isInitialized())
return NPERR_NO_ERROR;
return rv;
}
// ==============================
// ! Scriptability related code !
// ==============================
//
// here the plugin is asked by Mozilla to tell if it is scriptable
// we should return a valid interface id and a pointer to
// nsScriptablePeer interface which we should have implemented
// and which should be defined in the corressponding *.xpt file
// in the bin/components folder
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
if(instance == NULL)
return NPERR_GENERIC_ERROR;
CPlugin * pPlugin = (CPlugin *)instance->pdata;
if(pPlugin == NULL)
return NPERR_GENERIC_ERROR;
if (variable == NPPVpluginScriptableInstance) {
// addref happens in getter, so we don't addref here
nsI4xScriptablePlugin * scriptablePeer = pPlugin->getScriptablePeer();
if (scriptablePeer) {
*(nsISupports **)value = scriptablePeer;
} else {
rv = NPERR_OUT_OF_MEMORY_ERROR;
}
}
else if (variable == NPPVpluginScriptableIID) {
static nsIID scriptableIID = NS_I4XSCRIPTABLEPLUGIN_IID;
nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID));
if (ptr) {
*ptr = scriptableIID;
*(nsIID **)value = ptr;
} else {
rv = NPERR_OUT_OF_MEMORY_ERROR;
}
}
return rv;
}
NPError NPP_NewStream(NPP instance,
NPMIMEType type,
NPStream* stream,
NPBool seekable,
uint16* stype)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
int32 NPP_WriteReady (NPP instance, NPStream *stream)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32 rv = 0x0fffffff;
return rv;
}
int32 NPP_Write (NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32 rv = len;
return rv;
}
NPError NPP_DestroyStream (NPP instance, NPStream *stream, NPError reason)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
void NPP_StreamAsFile (NPP instance, NPStream* stream, const char* fname)
{
if(instance == NULL)
return;
}
void NPP_Print (NPP instance, NPPrint* printInfo)
{
if(instance == NULL)
return;
}
void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
{
if(instance == NULL)
return;
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
{
if(instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
int16 NPP_HandleEvent(NPP instance, void* event)
{
if(instance == NULL)
return 0;
int16 rv = 0;
CPlugin * pPlugin = (CPlugin *)instance->pdata;
if (pPlugin)
rv = pPlugin->handleEvent(event);
return rv;
}

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

@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface acmeIScriptObject;
[scriptable, uuid(482e1890-1fe5-11d5-9cf8-0060b0fbd8ac)]
interface nsI4xScriptablePlugin : nsISupports {
void showVersion();
void clear();
readonly attribute string version;
void setWindow(in acmeIScriptObject window);
};

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

@ -1,168 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// ==============================
// ! Scriptability related code !
// ==============================
//
/////////////////////////////////////////////////////
//
// This file implements the nsScriptablePeer object
// The native methods of this class are supposed to
// be callable from JavaScript
//
#include "plugin.h"
#include "acmeIScriptObject.h"
#include "npapi.h"
static NS_DEFINE_IID(kI4xScriptablePluginIID, NS_I4XSCRIPTABLEPLUGIN_IID);
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsScriptablePeer::nsScriptablePeer(CPlugin* aPlugin)
{
mRefCnt = 0;
mPlugin = aPlugin;
mWindow = nsnull;
}
nsScriptablePeer::~nsScriptablePeer()
{
}
// AddRef, Release and QueryInterface are common methods and must
// be implemented for any interface
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::AddRef()
{
++mRefCnt;
return mRefCnt;
}
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::Release()
{
--mRefCnt;
if (mRefCnt == 0) {
delete this;
return 0;
}
return mRefCnt;
}
// here nsScriptablePeer should return three interfaces it can be asked for by their iid's
// static casts are necessary to ensure that correct pointer is returned
NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if(!aInstancePtr)
return NS_ERROR_NULL_POINTER;
if(aIID.Equals(kI4xScriptablePluginIID)) {
*aInstancePtr = static_cast<nsI4xScriptablePlugin*>(this);
AddRef();
return NS_OK;
}
if(aIID.Equals(kIClassInfoIID)) {
*aInstancePtr = static_cast<nsIClassInfo*>(this);
AddRef();
return NS_OK;
}
if(aIID.Equals(kISupportsIID)) {
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsI4xScriptablePlugin*>(this));
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
}
//
// the following two methods will be callable from JavaScript
//
NS_IMETHODIMP nsScriptablePeer::ShowVersion()
{
if (mPlugin)
mPlugin->showVersion();
return NS_OK;
}
NS_IMETHODIMP nsScriptablePeer::Clear()
{
if (mPlugin)
mPlugin->clear();
return NS_OK;
}
NS_IMETHODIMP nsScriptablePeer::GetVersion(char * *aVersion)
{
if (mPlugin)
mPlugin->getVersion(aVersion);
return NS_OK;
}
NS_IMETHODIMP nsScriptablePeer::SetWindow(acmeIScriptObject *window)
{
NS_IF_ADDREF(window);
NS_IF_RELEASE(mWindow);
mWindow = window;
// evaluate a JavaScript expression.
acmeIScriptObject* result;
nsresult rv = window->Evaluate("Math.PI", &result);
if (NS_SUCCEEDED(rv) && result) {
double value;
result->ToNumber(&value);
NS_RELEASE(result);
}
// read the current window's location.
acmeIScriptObject* location = nsnull;
rv = window->GetProperty("location", &location);
if (NS_SUCCEEDED(rv) && location) {
char* locationStr = NULL;
rv = location->ToString(&locationStr);
if (NS_SUCCEEDED(rv) && locationStr) {
NPN_MemFree(locationStr);
}
NS_RELEASE(location);
}
return NS_OK;
}

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

@ -1,107 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// ==============================
// ! Scriptability related code !
// ==============================
//
// nsScriptablePeer - xpconnect scriptable peer
//
#ifndef __nsScriptablePeer_h__
#define __nsScriptablePeer_h__
#include "nsI4xScriptablePlugin.h"
#include "nsIClassInfo.h"
#include "nsIProgrammingLanguage.h"
class CPlugin;
// We must implement nsIClassInfo because it signals the
// Mozilla Security Manager to allow calls from JavaScript.
class nsClassInfoMixin : public nsIClassInfo
{
// These flags are used by the DOM and security systems to signal that
// JavaScript callers are allowed to call this object's scritable methods.
NS_IMETHOD GetFlags(PRUint32 *aFlags)
{*aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
return NS_OK;}
NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
{*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
return NS_OK;}
// The rest of the methods can safely return error codes...
NS_IMETHOD GetInterfaces(PRUint32 *count, nsIID * **array)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetContractID(char * *aContractID)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassDescription(char * *aClassDescription)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassID(nsCID * *aClassID)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
{return NS_ERROR_NOT_IMPLEMENTED;}
};
class nsScriptablePeer : public nsI4xScriptablePlugin,
public nsClassInfoMixin
{
public:
nsScriptablePeer(CPlugin* plugin);
~nsScriptablePeer();
public:
// methods from nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
protected:
nsrefcnt mRefCnt;
public:
// native methods callable from JavaScript
NS_DECL_NSI4XSCRIPTABLEPLUGIN
protected:
CPlugin* mPlugin;
acmeIScriptObject* mWindow;
};
#endif

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

@ -1,81 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// ==============================
// ! Scriptability related code !
// ==============================
//
/////////////////////////////////////////////////////
//
// This file implements the nsScriptablePeer object
// The native methods of this class are supposed to
// be callable from JavaScript
//
#include "plugin.h"
nsScriptablePeer::nsScriptablePeer(CPlugin* aPlugin)
{
mPlugin = aPlugin;
}
nsScriptablePeer::~nsScriptablePeer()
{
}
// Notice that we expose our claim to implement nsIClassInfo.
NS_IMPL_ISUPPORTS2(nsScriptablePeer, nsI4xScriptablePlugin, nsIClassInfo)
//
// the following two methods will be callable from JavaScript
//
NS_IMETHODIMP nsScriptablePeer::ShowVersion()
{
if (mPlugin)
mPlugin->showVersion();
return NS_OK;
}
NS_IMETHODIMP nsScriptablePeer::Clear()
{
if (mPlugin)
mPlugin->clear();
return NS_OK;
}

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

@ -1,96 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// ==============================
// ! Scriptability related code !
// ==============================
//
// nsScriptablePeer - xpconnect scriptable peer
//
#ifndef __nsScriptablePeer_h__
#define __nsScriptablePeer_h__
#include "nsI4xScriptablePlugin.h"
#include "nsIClassInfo.h"
#include "nsIProgrammingLanguage.h"
class CPlugin;
// We must implement nsIClassInfo because it signals the
// Mozilla Security Manager to allow calls from JavaScript.
class nsClassInfoMixin : public nsIClassInfo
{
// These flags are used by the DOM and security systems to signal that
// JavaScript callers are allowed to call this object's scritable methods.
NS_IMETHOD GetFlags(PRUint32 *aFlags)
{*aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
return NS_OK;}
NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
{*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
return NS_OK;}
// The rest of the methods can safely return error codes...
NS_IMETHOD GetInterfaces(PRUint32 *count, nsIID * **array)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetContractID(char * *aContractID)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassDescription(char * *aClassDescription)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassID(nsCID * *aClassID)
{return NS_ERROR_NOT_IMPLEMENTED;}
NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
{return NS_ERROR_NOT_IMPLEMENTED;}
};
class nsScriptablePeer : public nsI4xScriptablePlugin,
public nsClassInfoMixin
{
public:
nsScriptablePeer(CPlugin* plugin);
~nsScriptablePeer();
NS_DECL_ISUPPORTS
NS_DECL_NSI4XSCRIPTABLEPLUGIN
protected:
CPlugin* mPlugin;
};
#endif

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

@ -1,215 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//////////////////////////////////////////////////
//
// CPlugin class implementation
//
#ifdef XP_WIN
#include <windows.h>
#include <windowsx.h>
#endif
#ifdef XP_MAC
#include <TextEdit.h>
#endif
#include "plugin.h"
CPlugin::CPlugin(NPP pNPInstance) :
m_pNPInstance(pNPInstance),
m_pNPStream(NULL),
m_bInitialized(FALSE),
m_pScriptablePeer(NULL)
{
#ifdef XP_WIN
m_hWnd = NULL;
#endif
const char *ua = NPN_UserAgent(m_pNPInstance);
strcpy(m_String, ua);
}
CPlugin::~CPlugin()
{
NS_IF_RELEASE(m_pScriptablePeer);
}
#ifdef XP_WIN
static LRESULT CALLBACK PluginWinProc(HWND, UINT, WPARAM, LPARAM);
static WNDPROC lpOldProc = NULL;
#endif
NPBool CPlugin::init(NPWindow* pNPWindow)
{
if(pNPWindow == NULL)
return FALSE;
#ifdef XP_WIN
m_hWnd = (HWND)pNPWindow->window;
if(m_hWnd == NULL)
return FALSE;
// subclass window so we can intercept window messages and
// do our drawing to it
lpOldProc = SubclassWindow(m_hWnd, (WNDPROC)PluginWinProc);
// associate window with our CPlugin object so we can access
// it in the window procedure
SetWindowLong(m_hWnd, GWL_USERDATA, (LONG)this);
#endif
m_Window = pNPWindow;
m_bInitialized = TRUE;
return TRUE;
}
void CPlugin::shut()
{
#ifdef XP_WIN
// subclass it back
SubclassWindow(m_hWnd, lpOldProc);
m_hWnd = NULL;
#endif
m_bInitialized = FALSE;
}
NPBool CPlugin::isInitialized()
{
return m_bInitialized;
}
int16 CPlugin::handleEvent(void* event)
{
#ifdef XP_MAC
NPEvent* ev = (NPEvent*)event;
if (m_Window) {
Rect box = { m_Window->y, m_Window->x,
m_Window->y + m_Window->height, m_Window->x + m_Window->width };
if (ev->what == updateEvt) {
::TETextBox(m_String, strlen(m_String), &box, teJustCenter);
}
}
#endif
return 0;
}
// this will force to draw a version string in the plugin window
void CPlugin::showVersion()
{
const char *ua = NPN_UserAgent(m_pNPInstance);
strcpy(m_String, ua);
#ifdef XP_WIN
InvalidateRect(m_hWnd, NULL, TRUE);
UpdateWindow(m_hWnd);
#endif
if (m_Window) {
NPRect r = { m_Window->y, m_Window->x,
m_Window->y + m_Window->height, m_Window->x + m_Window->width };
NPN_InvalidateRect(m_pNPInstance, &r);
}
}
// this will clean the plugin window
void CPlugin::clear()
{
strcpy(m_String, "");
#ifdef XP_WIN
InvalidateRect(m_hWnd, NULL, TRUE);
UpdateWindow(m_hWnd);
#endif
}
void CPlugin::getVersion(char* *aVersion)
{
const char *ua = NPN_UserAgent(m_pNPInstance);
char*& version = *aVersion;
version = (char*)NPN_MemAlloc(1 + strlen(ua));
if (version)
strcpy(version, ua);
}
// ==============================
// ! Scriptability related code !
// ==============================
//
// this method will return the scriptable object (and create it if necessary)
nsI4xScriptablePlugin* CPlugin::getScriptablePeer()
{
if (!m_pScriptablePeer) {
m_pScriptablePeer = new nsScriptablePeer(this);
if(!m_pScriptablePeer)
return NULL;
NS_ADDREF(m_pScriptablePeer);
}
// add reference for the caller requesting the object
NS_ADDREF(m_pScriptablePeer);
return m_pScriptablePeer;
}
#ifdef XP_WIN
static LRESULT CALLBACK PluginWinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_PAINT:
{
// draw a frame and display the string
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
RECT rc;
GetClientRect(hWnd, &rc);
FrameRect(hdc, &rc, GetStockBrush(BLACK_BRUSH));
CPlugin * p = (CPlugin *)GetWindowLong(hWnd, GWL_USERDATA);
if(p)
DrawText(hdc, p->m_String, strlen(p->m_String), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hWnd, &ps);
}
break;
default:
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
#endif

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

@ -1,79 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __PLUGIN_H__
#define __PLUGIN_H__
#include "npapi.h"
#include "nsScriptablePeer.h"
class CPlugin
{
private:
NPP m_pNPInstance;
#ifdef XP_WIN
HWND m_hWnd;
#endif
NPWindow * m_Window;
NPStream * m_pNPStream;
NPBool m_bInitialized;
nsI4xScriptablePlugin * m_pScriptablePeer;
public:
char m_String[128];
public:
CPlugin(NPP pNPInstance);
~CPlugin();
NPBool init(NPWindow* pNPWindow);
void shut();
NPBool isInitialized();
int16 handleEvent(void* event);
void showVersion();
void clear();
void getVersion(char* *aVersion);
nsI4xScriptablePlugin* getScriptablePeer();
};
#endif // __PLUGIN_H__

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

@ -1,39 +0,0 @@
This is a plugin sample which demonstrates how with minimal modifications
in the 4.x legacy plugin code to achieve scripting functionality despite
of Mozilla not supporting LiveConnect in the way it was supported in
Netscape Communicator.
To build the sample:
1. create .xpt and nsI4xScrPlugin.h out of nsI4xScrPlugin.idl file
using Netscape idl compiler xpidl.exe. The command options are:
xpidl -m header nsI4xScrPlugin.idl
xpidl -m typelib nsI4xScrPlugin.idl
nsISupports.idl and nsrootidl.idl are needed for this.
2. create a project and build np4xscr.dll -- the plugin itself
3. place .xpt file in the components directory and the dll in the
plugins directory
4. load test.html and see it in work
The current sample code was written for Windows but can be easily
modified for other platforms.
Important notice: although developers who work on xpcom plugins
are strongly encouraged to use Netscape macros for common interface
method declarations and implementations, in the present sample we
decided to use their manual implementation. This is because the technique
shown in the sample may be useful for plugins which are supposed to
work under both Mozilla based browsers and Netscape Communicator
(4.x browsers). Using the macros requires linking against some
libraries which are not present in 4.x browsers (xpcom.lib, nspr.lib).
Files which under other circumstances would benefit from using
the macros are nsScriptablePeer.h and nsScriptablePeer.cpp. The versions
which use macros are also included (nsScriptablePeer1.h and
nsScriptablePeer1.cpp) for reference purposes.
Some header files from mozilla/dist/include and some .idl files from
mozilla/dist/idl are still needed to successfully build the sample.

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

@ -1,20 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by np4xscr.rc
//
#define IDD_MAIN 101
#define IDC_BUTTON_GO 1002
#define IDC_STATIC_UA 1003
#define IDC_BUTTON1 1005
#define IDC_BUTTON_DONT 1005
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -1,53 +0,0 @@
<html>
<body>
<embed type="application/mozilla-4x-scriptable-plugin" width=0 height=0>
</embed>
<script language="javascript">
var plugin = document.embeds[0];
document.write("version = " + plugin.version);
function jsScriptObject(obj)
{
// implementation detail, to allow unwrapping.
this.wrappedJSObject = obj;
}
jsScriptObject.prototype = {
getProperty : function(name)
{
return new jsScriptObject(this.wrappedJSObject[name]);
}
,
setProperty : function(name, value)
{
this.wrappedJSObject[name] = value;
}
,
evaluate : function(expression)
{
return new jsScriptObject(eval(expression));
}
,
toString : function()
{
return this.wrappedJSObject.toString();
}
,
toNumber : function()
{
return this.wrappedJSObject.valueOf();
}
,
fromString : function(value)
{
return new jsScriptObject(value);
}
,
fromNumber : function(value)
{
return new jsScriptObject(value);
}
};
plugin.setWindow(new jsScriptObject(window));
</script>
</body>
</html>

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

@ -1,48 +0,0 @@
<HTML>
<HEAD>
<TITLE>4x Scriptable Plug-in Test</TITLE>
</HEAD>
<BODY>
<center>
<h1> XPConnect Scriptable Old Style Sample Plug-in </h1>
</center>
This page contains a testcase which demonstrates the work of scriptable 4.x style
Navigator plug-in with Mozilla. The example plug-in occupies the area right below this text,
and you should see a frame the plug-in draws around its window. Below the plug-in window
there are two buttons. Clicking on the buttons will result in calling native plugin
methods from JavaScript. Show Version will instruct the plug-in to retrieve the
Mozilla user agent string and display it in the plug-in window, Clear button will
call plug-in method to erase the window.
<br><br>
<center>
<embed type="application/mozilla-4x-scriptable-plugin" width=600 height=40><br>
<script>
var embed = document.embeds[0];
function ShowVersion()
{
embed.showVersion();
}
function Clear()
{
embed.clear();
}
</script>
<br>
<form name="formname">
<input type=button value="Show Version" onclick='ShowVersion()'>
<input type=button value="Clear" onclick='Clear()'>
</form>
</center>
</BODY>
</HTML>

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

@ -1,530 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<?codewarrior exportversion="1.0.1" ideversion="4.2" ?>
<!DOCTYPE PROJECT [
<!ELEMENT PROJECT (TARGETLIST, TARGETORDER, GROUPLIST, DESIGNLIST?)>
<!ELEMENT TARGETLIST (TARGET+)>
<!ELEMENT TARGET (NAME, SETTINGLIST, FILELIST?, LINKORDER?, SEGMENTLIST?, OVERLAYGROUPLIST?, SUBTARGETLIST?, SUBPROJECTLIST?, FRAMEWORKLIST)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT USERSOURCETREETYPE (#PCDATA)>
<!ELEMENT PATH (#PCDATA)>
<!ELEMENT FILELIST (FILE*)>
<!ELEMENT FILE (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?, ROOTFILEREF?, FILEKIND?, FILEFLAGS?)>
<!ELEMENT PATHTYPE (#PCDATA)>
<!ELEMENT PATHROOT (#PCDATA)>
<!ELEMENT ACCESSPATH (#PCDATA)>
<!ELEMENT PATHFORMAT (#PCDATA)>
<!ELEMENT ROOTFILEREF (PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
<!ELEMENT FILEKIND (#PCDATA)>
<!ELEMENT FILEFLAGS (#PCDATA)>
<!ELEMENT FILEREF (TARGETNAME?, PATHTYPE, PATHROOT?, ACCESSPATH?, PATH, PATHFORMAT?)>
<!ELEMENT TARGETNAME (#PCDATA)>
<!ELEMENT SETTINGLIST ((SETTING|PANELDATA)+)>
<!ELEMENT SETTING (NAME?, (VALUE|(SETTING+)))>
<!ELEMENT PANELDATA (NAME, VALUE)>
<!ELEMENT VALUE (#PCDATA)>
<!ELEMENT LINKORDER (FILEREF*)>
<!ELEMENT SEGMENTLIST (SEGMENT+)>
<!ELEMENT SEGMENT (NAME, ATTRIBUTES?, FILEREF*)>
<!ELEMENT ATTRIBUTES (#PCDATA)>
<!ELEMENT OVERLAYGROUPLIST (OVERLAYGROUP+)>
<!ELEMENT OVERLAYGROUP (NAME, BASEADDRESS, OVERLAY*)>
<!ELEMENT BASEADDRESS (#PCDATA)>
<!ELEMENT OVERLAY (NAME, FILEREF*)>
<!ELEMENT SUBTARGETLIST (SUBTARGET+)>
<!ELEMENT SUBTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
<!ELEMENT SUBPROJECTLIST (SUBPROJECT+)>
<!ELEMENT SUBPROJECT (FILEREF, SUBPROJECTTARGETLIST)>
<!ELEMENT SUBPROJECTTARGETLIST (SUBPROJECTTARGET*)>
<!ELEMENT SUBPROJECTTARGET (TARGETNAME, ATTRIBUTES?, FILEREF?)>
<!ELEMENT FRAMEWORKLIST (FRAMEWORK+)>
<!ELEMENT FRAMEWORK (FILEREF, LIBRARYFILE?, VERSION?)>
<!ELEMENT LIBRARYFILE (FILEREF)>
<!ELEMENT VERSION (#PCDATA)>
<!ELEMENT TARGETORDER (ORDEREDTARGET|ORDEREDDESIGN)*>
<!ELEMENT ORDEREDTARGET (NAME)>
<!ELEMENT ORDEREDDESIGN (NAME, ORDEREDTARGET+)>
<!ELEMENT GROUPLIST (GROUP|FILEREF)*>
<!ELEMENT GROUP (NAME, (GROUP|FILEREF)*)>
<!ELEMENT DESIGNLIST (DESIGN+)>
<!ELEMENT DESIGN (NAME, DESIGNDATA)>
<!ELEMENT DESIGNDATA (#PCDATA)>
]>
<PROJECT>
<TARGETLIST>
<TARGET>
<NAME>BasicPluginCarbon</NAME>
<SETTINGLIST>
<!-- Settings for "Source Trees" panel -->
<SETTING><NAME>UserSourceTrees</NAME><VALUE></VALUE></SETTING>
<!-- Settings for "Access Paths" panel -->
<SETTING><NAME>AlwaysSearchUserPaths</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>InterpretDOSAndUnixPaths</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>RequireFrameworkStyleIncludes</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>UserSearchPaths</NAME>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>::</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:::include:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:::common:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>::::include:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
</SETTING>
<SETTING><NAME>SystemSearchPaths</NAME>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:MSL:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:MacOS Support:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>CodeWarrior</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>MacOS</VALUE></SETTING>
</SETTING>
</SETTING>
<!-- Settings for "Debugger Runtime" panel -->
<SETTING><NAME>MWRuntimeSettings_WorkingDirectory</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWRuntimeSettings_CommandLine</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWRuntimeSettings_HostApplication</NAME>
<SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
</SETTING>
<SETTING><NAME>MWRuntimeSettings_EnvVars</NAME><VALUE></VALUE></SETTING>
<!-- Settings for "Target Settings" panel -->
<SETTING><NAME>Linker</NAME><VALUE>MacOS PPC Linker</VALUE></SETTING>
<SETTING><NAME>PreLinker</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>PostLinker</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Targetname</NAME><VALUE>BasicPluginCarbon</VALUE></SETTING>
<SETTING><NAME>OutputDirectory</NAME>
<SETTING><NAME>Path</NAME><VALUE>:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>SaveEntriesUsingRelativePaths</NAME><VALUE>false</VALUE></SETTING>
<!-- Settings for "File Mappings" panel -->
<SETTING><NAME>FileMappings</NAME>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>APPL</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>Appl</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>MMLB</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>Lib Import PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>MPLF</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>Lib Import PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>MWCD</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>RSRC</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.bh</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>Balloon Help</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.c</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.c++</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.cc</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.cp</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.cpp</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.exp</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.h</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.p</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW Pascal PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.pas</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW Pascal PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.pch</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.pch++</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>MW C/C++ PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>C/C++</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.r</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>Rez</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE>Rez</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.s</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>PPCAsm</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>XCOF</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>XCOFF Import PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>docu</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>rsrc</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>shlb</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>PEF Import PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileType</NAME><VALUE>stub</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE>PEF Import PPC</VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>false</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.doc</VALUE></SETTING>
<SETTING><NAME>Compiler</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>EditLanguage</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>ResourceFile</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>IgnoredByMake</NAME><VALUE>true</VALUE></SETTING>
</SETTING>
</SETTING>
<!-- Settings for "Build Extras" panel -->
<SETTING><NAME>CacheModDates</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ActivateBrowser</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>DumpBrowserInfo</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>CacheSubprojects</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>UseThirdPartyDebugger</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>DebuggerAppPath</NAME>
<SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
</SETTING>
<SETTING><NAME>DebuggerCmdLineArgs</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>DebuggerWorkingDir</NAME>
<SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
</SETTING>
<!-- Settings for "Debugger Target" panel -->
<SETTING><NAME>LogSystemMessages</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>AutoTargetDLLs</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>StopAtWatchpoints</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>PauseWhileRunning</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>PauseInterval</NAME><VALUE>5</VALUE></SETTING>
<SETTING><NAME>PauseUIFlags</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>AltExePath</NAME>
<SETTING><NAME>Path</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
</SETTING>
<SETTING><NAME>StopAtTempBPOnLaunch</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>CacheSymbolics</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>TempBPFunctionName</NAME><VALUE>main</VALUE></SETTING>
<SETTING><NAME>TempBPType</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "Remote Debug" panel -->
<SETTING><NAME>Enabled</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>ConnectionName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>DownloadPath</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>LaunchRemoteApp</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>RemoteAppPath</NAME><VALUE></VALUE></SETTING>
<!-- Settings for "Auto-target" panel -->
<SETTING><NAME>OtherExecutables</NAME><VALUE></VALUE></SETTING>
<!-- Settings for "Custom Keywords" panel -->
<SETTING><NAME>CustomColor1</NAME>
<SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>Green</NAME><VALUE>39321</VALUE></SETTING>
<SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
</SETTING>
<SETTING><NAME>CustomColor2</NAME>
<SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
<SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
</SETTING>
<SETTING><NAME>CustomColor3</NAME>
<SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
<SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
</SETTING>
<SETTING><NAME>CustomColor4</NAME>
<SETTING><NAME>Red</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>Green</NAME><VALUE>32767</VALUE></SETTING>
<SETTING><NAME>Blue</NAME><VALUE>0</VALUE></SETTING>
</SETTING>
<!-- Settings for "C/C++ Compiler" panel -->
<SETTING><NAME>MWFrontEnd_C_cplusplus</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_checkprotos</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_arm</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_trigraphs</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_onlystdkeywords</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_enumsalwaysint</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_mpwpointerstyle</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_prefixname</NAME><VALUE>pluginCarbonPrefix.h</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_ansistrict</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_mpwcnewline</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_wchar_type</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_enableexceptions</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_dontreusestrings</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_poolstrings</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_dontinline</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_useRTTI</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_multibyteaware</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_unsignedchars</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_autoinline</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_booltruefalse</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_direct_to_som</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_som_env_check</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_alwaysinline</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_inlinelevel</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_ecplusplus</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_objective_c</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWFrontEnd_C_defer_codegen</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "C/C++ Warnings" panel -->
<SETTING><NAME>MWWarning_C_warn_illpragma</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_emptydecl</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_possunwant</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_unusedvar</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_unusedarg</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_extracomma</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_pedantic</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warningerrors</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_hidevirtual</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_implicitconv</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_notinlined</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWWarning_C_warn_structclass</NAME><VALUE>0</VALUE></SETTING>
<!-- Settings for "FTP Panel" panel -->
<SETTING><NAME>MWFTP_Post_hostName</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_username</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>MWFTP_Post_password</NAME><VALUE>263pi6sn63j4esi,p'

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

@ -0,0 +1,3 @@
Basic Plugin
You should see the plugin window with a black frame aroung it and the browser user agent string drawn inside.

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

@ -0,0 +1,3 @@
NPRuntime Plugin
This sample plugin can be scripted, JavaScript can call into the plugin via NPRuntime.

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

@ -1,4 +1,4 @@
03-05-2002
NPThread Plugin
This sample is an attempt to write a wrapper plugin which would run the
real plugin in a separate thread. The current code is just a first prototype

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

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

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

@ -0,0 +1,3 @@
Scriptable Plugin
This sample plugin can be scripted, JavaScript can call into the plugin via NPRuntime.

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

@ -1,84 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = npsimple
LIBRARY_NAME = npsimple
IS_COMPONENT = 1
MODULE_NAME = SimplePlugin
# Ack! we should not be using the internal API or linking against
# MOZ_COMPONENT_LIBS!
MOZILLA_INTERNAL_API = 1
REQUIRES = xpcom \
string \
plugin \
widget \
$(NULL)
# Make sure that it builds but don't install it
NO_DIST_INSTALL = 1
NO_INSTALL = 1
XPIDLSRCS = nsISimplePluginInstance.idl
CPPSRCS = npsimple.cpp
LOCAL_INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../public -I$(XPIDL_GEN_DIR)
EXTRA_DSO_LDOPTS += \
-L$(DIST)/lib \
-lgtksuperwin \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
libs::
$(INSTALL) $(srcdir)/test.html $(DIST)/bin/res/samples
install::
$(SYSINSTALL) $(IFLAGS1) $(srcdir)/test.html $(DESTDIR)$(mozappdir)/res/samples

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

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

@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
* A sample interface to show calling the plugin from JavaScript via XPConnect.
*
*/
#include "nsISupports.idl"
[scriptable, uuid(fa8728f0-117a-11d4-8fa5-0010a4e73d9a)]
interface nsISimplePluginInstance : nsISupports
{
attribute string text;
};

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

@ -1,44 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __SIMPLECID_H
#define __SIMPLECID_H
// {312DA841-3DBF-11d3-BCFB-00A0C9C8D91D}
#define NS_SIMPLEPLUGIN_CID { 0x312da841, 0x3dbf, 0x11d3, { 0xbc, 0xfb, 0x0, 0xa0, 0xc9, 0xc8, 0xd9, 0x1d } }
#endif

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

@ -1,12 +0,0 @@
<html>
<head>
<title>Simple Test</title>
</head>
<body>
<center>
<h1>Simple Test</h1>
<embed type="application/x-simple" text="Hello World">
</center>
</body>
</html>

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

@ -1,5 +1,3 @@
README for the plugin event sample.
INTENT:
-------
The intent of this plugin is to demonstrate how to implement a
@ -46,4 +44,4 @@ PROBLEMS:
MAC NOTES:
----------
No Mac support at all.
No Mac support.

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

@ -0,0 +1,3 @@
unixprinting plugin
Sample plugin for plugin printing.

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

@ -0,0 +1,3 @@
Winless Plugin
This is a windowless plugin sample.