Added simple LiveConnected plugin test case that used backward adapter.

This commit is contained in:
warren 1998-07-11 01:40:24 +00:00
Родитель 55ae26173a
Коммит ecd86e832d
20 изменённых файлов: 3786 добавлений и 0 удалений

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

@ -0,0 +1,40 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#! gmake
MODULE = npsimple
LIBRARY_NAME = npsimple
DEPTH = ../../..
REQUIRES = java plug xpcom
CSRCS = stubs.c
CPPSRCS = npsimple.cpp bad.cpp
JDIRS = .
JRI_GEN = \
Simple \
java.lang.Object \
netscape.plugin.Plugin \
CINCLUDES += $(PUBLIC)/plugin $(PUBLIC)/xpcom $(PUBLIC)/java
include $(DEPTH)/config/rules.mk

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

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
import netscape.plugin.Plugin;
class Simple extends Plugin {
/*
** A plug-in can consist of code written in java as well as
** natively. Here's a dummy method.
*/
public static int fact(int n) {
if (n == 1)
return 1;
else
return n * fact(n-1);
}
/*
** This instance variable is used to keep track of the number of
** times we've called into this plug-in.
*/
int count;
/*
** This native method will give us a way to print to stdout from java
** instead of just the java console.
*/
native void printToStdout(String msg);
/*
** This is a publically callable new feature that our plug-in is
** providing. We can call it from JavaScript, Java, or from native
** code.
*/
public void doit(String text) {
/* construct a message */
String msg = "" + (++count) + ". " + text + "\n";
/* write it to the console */
System.out.print(msg);
/* and also write it to stdout */
printToStdout(msg);
}
}

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

@ -0,0 +1,24 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
LIBRARY NPSimp32
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD SINGLE
EXPORTS
NSGetFactory @1

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

@ -0,0 +1,145 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#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
#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
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\CharFlipper.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
#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 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Simple Example Plugin\0"
VALUE "FileExtents", "smp\0"
VALUE "FileOpenName", "Simple Plugin File (*.smp)\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "CHARFLIPPER\0"
VALUE "LegalCopyright", "Copyright © 1996\0"
VALUE "MIMEType", "application/x-simple-plugin\0"
VALUE "OriginalFilename", "NPSimp32.dll\0"
VALUE "ProductName", "HelloWorld Example Plugin\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -0,0 +1,72 @@
<HTML>
<H1> Simple LiveConnect Sample Plug-in </H1>
<p> This sample plug-in demonstrates how to write a
LiveConnect-enabled plug-in. You should see in the plug-in rectangle
below the text "Hello World" and messages written to the Java Console
and to stdout to tell you what it's doing. And if you click the
JavaScript button, it will tell you another thing or two.
<HR>
<center>
<EMBED type=application/x-simple-plugin name="simple1" width=400 height=300>
<form>
<input type=button value="Click Me"
onclick='document.simple1.doit("Hello from JavaScript!")'>
</form>
<h4>Open the Java Console (under the Options menu) to see the
output!</h4>
</center>
<h4>Problems?</h4>
<ul>
<p><li><b>I don't see any output in the Java Console or to stdout</b>:
This is probably because the Simple.class file isn't installed
correctly. For Macintosh, the class file must be in "System
Folder:Preferences:Netscape Ÿ:Java:netscape-classes". (In the next beta
release it should be possible to simply place the class file in the
plugins directory.) For Windows, the class file should be in the Plug-in
folder along side the DLL.
<p><li><b>I still don't see any output in the Java Console or to
stdout</b>: This may be because you don't have your moz3_0.zip file in
the proper place. Try visiting a page with an applet to see if it
works. Also make sure that Java isn't disabled (under the Options
menu, Network Preferences..., Language).
<p><li><b>I get a dialog offering to download the plugin</b>: This is
most likely because the Plug-in file (npsimple.dll on Windows,
npsimple.so on Unix, or SimplePPC on PowerPC Mac) isn't installed in the
plug-in directory. Also check that the list of helpers (under Options,
General Preferences..., Helpers) contains an entry for type
application/x-simple-plugin that names the Simple LiveConnect Sample
Plug-in.
<p><li><b>I get Java Console output, but nothing to stdout</b>: If
you're on a Mac, forget it. You'll never see stdout. If you're on a
Windows machine and you launched the Navigator by double clicking an
icon, you also won't get any stdout.
<p><li><b>When I click the button, I get an error dialog from
JavaScript saying "Window.Function.Document.simple1 has no
properties."</b>: This is because the Simple.class file was not found
in the Plug-ins directory. You'll also notice that you're not getting
any messages to the console in this case.
<p><li><b>Other problems?</b>: Check with the Netscape
LiveConnect/Plug-in developer's news group, <a
href="snews://secnews/netscape.devs-plugins">
snews://secnews/netscape.devs-plugins</a>.
</ul>
<HR>
</HTML>

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

@ -0,0 +1,86 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
NODEPEND=1
MODULE = npsimple
LIBRARY_NAME = npsimple
DEPTH = ..\..\..
REQUIRES = java plug xpcom
OBJS = .\$(OBJDIR)\npsimple.obj \
.\$(OBJDIR)\stubs.obj \
.\$(OBJDIR)\stubs2.obj
JDIRS = .
JRI_GEN = \
Simple \
java.lang.Object \
netscape.plugin.Plugin \
MAKE_OBJ_TYPE=DLL
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
DLLNAME=npsimple.dll
PDBFILE=npsimple.pdb
MAPFILE=npsimple.map
DEFFILE=Simple32.def
RESFILE=Simple32.res
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//
#//------------------------------------------------------------------------
DLL=.\$(OBJDIR)\$(DLLNAME)
MAPFILE= npsimple.map
#//------------------------------------------------------------------------
#//
#// Define any local options for the make tools
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
#//
#//------------------------------------------------------------------------
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom32.lib
# clobber and clobber_all will remove the following garbage:
GARBAGE = $(GARBAGE) _gen
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
LINCS=$(LINCS) -I$(PUBLIC)\plugin -I$(PUBLIC)\xpcom -I$(PUBLIC)\java -I$(PUBLIC)\plugimpl
install:: $(DLL)
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple
$(MAKE_INSTALL) $(XPDIST)\classes11\Simple.class $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple
$(MAKE_INSTALL) $(OBJDIR)\npsimple.dll $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple

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

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

@ -0,0 +1,33 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Simple32.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "_jri/netscape_plugin_Plugin.c"
/*
** Define IMPLEMENT_Simple in order to pull the stub code in when
** compiling the Simple.c file. Without doing this, we'd get a
** UnsatisfiedLinkError whenever we tried to call one of the native
** methods:
*/
#define IMPLEMENT_Simple
/*
** Include the native stubs, initialization routines and
** debugging code. You should be building with DEBUG defined in order to
** take advantage of the diagnostic code that javah creates for
** you. Otherwise your life will be hell.
*/
#include "_jri/Simple.c"
#include "prtypes.h"
#include "npapi.h"
// Include the old API glue file.
#ifdef XP_UNIX
# include "npunix.c"
#endif

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

@ -0,0 +1,30 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// Include the backward adapter to make this plugin run in pre-5.0 browsers too:
#include "prtypes.h"
#include "../bad/badapter.cpp"
#include "npapi.h"
// Include the old API glue file.
#ifdef XP_WIN
# include "npwin.cpp"
#elif XP_MAC
# include "npmac.cpp"
#endif

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

@ -0,0 +1,40 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#! gmake
MODULE = npsimple
LIBRARY_NAME = npsimple
DEPTH = ../../..
REQUIRES = java plug xpcom
CSRCS = stubs.c
CPPSRCS = npsimple.cpp bad.cpp
JDIRS = .
JRI_GEN = \
Simple \
java.lang.Object \
netscape.plugin.Plugin \
CINCLUDES += $(PUBLIC)/plugin $(PUBLIC)/xpcom $(PUBLIC)/java
include $(DEPTH)/config/rules.mk

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

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
import netscape.plugin.Plugin;
class Simple extends Plugin {
/*
** A plug-in can consist of code written in java as well as
** natively. Here's a dummy method.
*/
public static int fact(int n) {
if (n == 1)
return 1;
else
return n * fact(n-1);
}
/*
** This instance variable is used to keep track of the number of
** times we've called into this plug-in.
*/
int count;
/*
** This native method will give us a way to print to stdout from java
** instead of just the java console.
*/
native void printToStdout(String msg);
/*
** This is a publically callable new feature that our plug-in is
** providing. We can call it from JavaScript, Java, or from native
** code.
*/
public void doit(String text) {
/* construct a message */
String msg = "" + (++count) + ". " + text + "\n";
/* write it to the console */
System.out.print(msg);
/* and also write it to stdout */
printToStdout(msg);
}
}

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

@ -0,0 +1,24 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
LIBRARY NPSimp32
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD SINGLE
EXPORTS
NSGetFactory @1

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

@ -0,0 +1,145 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#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
#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
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\CharFlipper.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
#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 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Simple Example Plugin\0"
VALUE "FileExtents", "smp\0"
VALUE "FileOpenName", "Simple Plugin File (*.smp)\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "CHARFLIPPER\0"
VALUE "LegalCopyright", "Copyright © 1996\0"
VALUE "MIMEType", "application/x-simple-plugin\0"
VALUE "OriginalFilename", "NPSimp32.dll\0"
VALUE "ProductName", "HelloWorld Example Plugin\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -0,0 +1,72 @@
<HTML>
<H1> Simple LiveConnect Sample Plug-in </H1>
<p> This sample plug-in demonstrates how to write a
LiveConnect-enabled plug-in. You should see in the plug-in rectangle
below the text "Hello World" and messages written to the Java Console
and to stdout to tell you what it's doing. And if you click the
JavaScript button, it will tell you another thing or two.
<HR>
<center>
<EMBED type=application/x-simple-plugin name="simple1" width=400 height=300>
<form>
<input type=button value="Click Me"
onclick='document.simple1.doit("Hello from JavaScript!")'>
</form>
<h4>Open the Java Console (under the Options menu) to see the
output!</h4>
</center>
<h4>Problems?</h4>
<ul>
<p><li><b>I don't see any output in the Java Console or to stdout</b>:
This is probably because the Simple.class file isn't installed
correctly. For Macintosh, the class file must be in "System
Folder:Preferences:Netscape Ÿ:Java:netscape-classes". (In the next beta
release it should be possible to simply place the class file in the
plugins directory.) For Windows, the class file should be in the Plug-in
folder along side the DLL.
<p><li><b>I still don't see any output in the Java Console or to
stdout</b>: This may be because you don't have your moz3_0.zip file in
the proper place. Try visiting a page with an applet to see if it
works. Also make sure that Java isn't disabled (under the Options
menu, Network Preferences..., Language).
<p><li><b>I get a dialog offering to download the plugin</b>: This is
most likely because the Plug-in file (npsimple.dll on Windows,
npsimple.so on Unix, or SimplePPC on PowerPC Mac) isn't installed in the
plug-in directory. Also check that the list of helpers (under Options,
General Preferences..., Helpers) contains an entry for type
application/x-simple-plugin that names the Simple LiveConnect Sample
Plug-in.
<p><li><b>I get Java Console output, but nothing to stdout</b>: If
you're on a Mac, forget it. You'll never see stdout. If you're on a
Windows machine and you launched the Navigator by double clicking an
icon, you also won't get any stdout.
<p><li><b>When I click the button, I get an error dialog from
JavaScript saying "Window.Function.Document.simple1 has no
properties."</b>: This is because the Simple.class file was not found
in the Plug-ins directory. You'll also notice that you're not getting
any messages to the console in this case.
<p><li><b>Other problems?</b>: Check with the Netscape
LiveConnect/Plug-in developer's news group, <a
href="snews://secnews/netscape.devs-plugins">
snews://secnews/netscape.devs-plugins</a>.
</ul>
<HR>
</HTML>

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

@ -0,0 +1,86 @@
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
NODEPEND=1
MODULE = npsimple
LIBRARY_NAME = npsimple
DEPTH = ..\..\..
REQUIRES = java plug xpcom
OBJS = .\$(OBJDIR)\npsimple.obj \
.\$(OBJDIR)\stubs.obj \
.\$(OBJDIR)\stubs2.obj
JDIRS = .
JRI_GEN = \
Simple \
java.lang.Object \
netscape.plugin.Plugin \
MAKE_OBJ_TYPE=DLL
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
DLLNAME=npsimple.dll
PDBFILE=npsimple.pdb
MAPFILE=npsimple.map
DEFFILE=Simple32.def
RESFILE=Simple32.res
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//
#//------------------------------------------------------------------------
DLL=.\$(OBJDIR)\$(DLLNAME)
MAPFILE= npsimple.map
#//------------------------------------------------------------------------
#//
#// Define any local options for the make tools
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
#//
#//------------------------------------------------------------------------
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom32.lib
# clobber and clobber_all will remove the following garbage:
GARBAGE = $(GARBAGE) _gen
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
LINCS=$(LINCS) -I$(PUBLIC)\plugin -I$(PUBLIC)\xpcom -I$(PUBLIC)\java -I$(PUBLIC)\plugimpl
install:: $(DLL)
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins
-mkdir $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple
$(MAKE_INSTALL) $(XPDIST)\classes11\Simple.class $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple
$(MAKE_INSTALL) $(OBJDIR)\npsimple.dll $(DEPTH)\cmd\winfe\mkfiles32\x86dbg\plugins\simple

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

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

@ -0,0 +1,33 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Simple32.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "_jri/netscape_plugin_Plugin.c"
/*
** Define IMPLEMENT_Simple in order to pull the stub code in when
** compiling the Simple.c file. Without doing this, we'd get a
** UnsatisfiedLinkError whenever we tried to call one of the native
** methods:
*/
#define IMPLEMENT_Simple
/*
** Include the native stubs, initialization routines and
** debugging code. You should be building with DEBUG defined in order to
** take advantage of the diagnostic code that javah creates for
** you. Otherwise your life will be hell.
*/
#include "_jri/Simple.c"
#include "prtypes.h"
#include "npapi.h"
// Include the old API glue file.
#ifdef XP_UNIX
# include "npunix.c"
#endif

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

@ -0,0 +1,30 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// Include the backward adapter to make this plugin run in pre-5.0 browsers too:
#include "prtypes.h"
#include "../bad/badapter.cpp"
#include "npapi.h"
// Include the old API glue file.
#ifdef XP_WIN
# include "npwin.cpp"
#elif XP_MAC
# include "npmac.cpp"
#endif