Commit 4565dc6e authored by Sam Hocevar's avatar Sam Hocevar

* ./mozilla/*: preliminary Mozilla plugin. Only works under Unix for now.

  * ./debian/rules: activated the vlc-xosd, vlc-kde and mozilla-plugin-vlc
    Debian packages.
  * ./po/*: updated potfiles.
parent 7f0d9408
......@@ -249,7 +249,7 @@ export
#
# Virtual targets
#
all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
Makefile.opts:
@echo "**** No configuration found, please run ./configure"
......@@ -274,7 +274,7 @@ show:
#
# Cleaning rules
#
clean: plugins-clean po-clean vlc-clean
clean: plugins-clean po-clean vlc-clean mozilla-clean
rm -f src/*/*.o extras/*/*.o
rm -f lib/*.so* lib/*.a
rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
......@@ -294,6 +294,9 @@ vlc-clean:
rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
rm -Rf vlc.app
mozilla-clean:
-cd mozilla && $(MAKE) clean
distclean: clean
-cd po && $(MAKE) maintainer-clean
rm -f **/*.o **/*~ *.log
......@@ -308,9 +311,9 @@ distclean: clean
#
# Install/uninstall rules
#
install: vlc-install plugins-install po-install
install: vlc-install plugins-install po-install mozilla-install
uninstall: vlc-uninstall plugins-uninstall po-uninstall
uninstall: vlc-uninstall plugins-uninstall po-uninstall mozilla-uninstall
vlc-install:
mkdir -p $(DESTDIR)$(bindir)
......@@ -341,6 +344,16 @@ endif
plugins-uninstall:
rm -f $(DESTDIR)$(libdir)/vlc/*.so
mozilla-install:
ifeq ($(MOZILLA),1)
-cd mozilla && $(MAKE) install
endif
mozilla-uninstall:
ifeq ($(MOZILLA),1)
-cd mozilla && $(MAKE) uninstall
endif
po-install:
-cd po && $(MAKE) install
......@@ -606,6 +619,14 @@ builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
$(BUILTIN_OBJ): $(H_OBJ) FORCE
@cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
#
# Mozilla plugin target
#
mozilla/libvlcplugin.so: FORCE
ifeq ($(MOZILLA),1)
@cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"
endif
#
# gettext target
#
......
......@@ -14,6 +14,7 @@ HAVE_MAKEFILE_OPTS = 1
#
SYS = @SYS@
ALIASES =@ALIASES@
MOZILLA = @MOZILLA@
INSTALL = @INSTALL@
ARCH = @ARCH@
......@@ -53,8 +54,9 @@ includedir = @includedir@
# CFLAGS for special cases
#
vlc_CFLAGS = @vlc_CFLAGS@
plugins_CFLAGS := @plugins_CFLAGS@
builtins_CFLAGS := @builtins_CFLAGS@
plugins_CFLAGS = @plugins_CFLAGS@
builtins_CFLAGS = @builtins_CFLAGS@
mozilla_CFLAGS = @mozilla_CFLAGS@
a52_CFLAGS = @a52_CFLAGS@
arts_CFLAGS = @arts_CFLAGS@
......@@ -82,8 +84,9 @@ xvideo_CFLAGS = @xvideo_CFLAGS@
# Libraries for special cases
#
vlc_LDFLAGS = @vlc_LDFLAGS@
plugins_LDFLAGS += @plugins_LDFLAGS@
builtins_LDFLAGS += @builtins_LDFLAGS@
plugins_LDFLAGS = @plugins_LDFLAGS@
builtins_LDFLAGS = @builtins_LDFLAGS@
mozilla_LDFLAGS = @mozilla_LDFLAGS@
a52_LDFLAGS = @a52_LDFLAGS@
aa_LDFLAGS = @aa_LDFLAGS@
......
This diff is collapsed.
......@@ -1651,6 +1651,23 @@ AC_ARG_ENABLE(st,
vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
dnl
dnl Mozilla plugin
dnl
MOZILLA=0
AC_ARG_ENABLE(mozilla,
[ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
if test x$enable_mozilla = xyes
then
AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
if test x${MOZILLA_CONFIG} != xno
then
MOZILLA=1
mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs `"
fi
fi
dnl
dnl Plug-ins - this must be AT THE END
dnl
......@@ -1716,6 +1733,7 @@ AC_SUBST(BCBUILDER)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(NEED_GETOPT)
AC_SUBST(MOZILLA)
AC_SUBST(CFLAGS_OPTIM)
AC_SUBST(CFLAGS_OPTIM_NODEBUG)
......@@ -1724,6 +1742,7 @@ AC_SUBST(LDFLAGS)
AC_SUBST(vlc_CFLAGS)
AC_SUBST(plugins_CFLAGS)
AC_SUBST(builtins_CFLAGS)
AC_SUBST(mozilla_CFLAGS)
AC_SUBST(a52_CFLAGS)
AC_SUBST(arts_CFLAGS)
......@@ -1751,6 +1770,7 @@ AC_SUBST(xvideo_CFLAGS)
AC_SUBST(vlc_LDFLAGS)
AC_SUBST(plugins_LDFLAGS)
AC_SUBST(builtins_LDFLAGS)
AC_SUBST(mozilla_LDFLAGS)
AC_SUBST(a52_LDFLAGS)
AC_SUBST(aa_LDFLAGS)
......@@ -1811,6 +1831,7 @@ profiling : ${PROFILING}
need builtin getopt : ${NEED_GETOPT}
built-in modules :${BUILTINS}
plug-in modules :${PLUGINS}
mozilla plugin : ${MOZILLA}
vlc aliases :${ALIASES}
You may now tune Makefile.opts at your convenience, for instance to choose
......
tmp
vlc
vlc-*
mozilla-plugin-vlc
delete
files
*debhelper
......
vlc (0.5.0-0CVS) unstable; urgency=low
* Current CVS - do NOT release as is!
-- Samuel Hocevar <sam@zoy.org> Thu, 4 Jul 2002 17:44:25 +0200
vlc (0.4.1-1) unstable; urgency=low
* New upstream release.
-- Samuel Hocevar <sam@zoy.org> Mon, 3 Jun 2002 23:43:35 +0200
vlc (0.4.0-1) unstable; urgency=low
* New upstrea release.
* New upstream release.
-- Samuel Hocevar <sam@zoy.org> Thu, 23 May 2002 01:27:05 +0200
......
......@@ -2,7 +2,7 @@ Source: vlc
Section: graphics
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev
Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, kdelibs-dev
Standards-Version: 3.5.6
Package: vlc
......@@ -20,7 +20,7 @@ Package: vlc-gnome
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Provides: vlc-gui
Description: Gnome plugin for vlc
Description: GNOME interface plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds a Gnome interface to vlc, the VideoLAN Client. To
......@@ -32,7 +32,7 @@ Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Replaces: vlc-gnome (<= 0.2.63-2)
Conflicts: vlc-gnome (<= 0.2.63-2)
Provides: vlc-gui
Description: Gtk+ plugin for vlc
Description: Gtk+ interface plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds a Gtk+ interface to vlc, the VideoLAN Client. To
......@@ -41,7 +41,7 @@ Description: Gtk+ plugin for vlc
Package: vlc-esd
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: Esound plugin for vlc
Description: Esound audio output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for the Enlightened Sound Daemon to vlc, the
......@@ -51,7 +51,7 @@ Description: Esound plugin for vlc
Package: vlc-alsa
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: ALSA plugin for vlc
Description: ALSA audio output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for the Advanced Linux Sound Architecture to
......@@ -61,7 +61,7 @@ Description: ALSA plugin for vlc
Package: vlc-sdl
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: SDL plugin for vlc
Description: SDL video and audio output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for the Simple DirectMedia Layer library to
......@@ -72,7 +72,7 @@ Description: SDL plugin for vlc
Package: vlc-ggi
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: GGI plugin for vlc
Description: GGI video output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This is a GGI plugin for vlc, the VideoLAN Client. To activate it, use
......@@ -82,7 +82,7 @@ Description: GGI plugin for vlc
Package: vlc-glide
Architecture: i386
Depends: vlc (= ${Source-Version}), libglide2
Description: Glide plugin for vlc
Description: Glide video output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This is a Glide (3dfx) plugin for vlc, the VideoLAN Client. To activate
......@@ -93,7 +93,7 @@ Package: vlc-qt
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Provides: vlc-gui
Description: Qt plugin for vlc
Description: Qt interface plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds a Qt interface to vlc, the VideoLAN Client. To
......@@ -102,7 +102,7 @@ Description: Qt plugin for vlc
Package: vlc-mad
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: MAD plugin for vlc
Description: MAD audio codec plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for libmad, the MPEG audio decoder library,
......@@ -113,7 +113,7 @@ Description: MAD plugin for vlc
Package: vlc-arts
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: aRts plugin for vlc
Description: aRts audio output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for the aRts Sound System to vlc, the
......@@ -123,7 +123,7 @@ Description: aRts plugin for vlc
Package: vlc-lirc
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: lirc (infrared remote control) plugin for vlc
Description: lirc (infrared remote control) interface plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin is an infrared lirc interface for vlc, the
......@@ -132,9 +132,40 @@ Description: lirc (infrared remote control) plugin for vlc
Package: vlc-aa
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: ASCII art plugin for vlc
Description: ASCII art video output plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This is an ASCII art video output plugin for vlc, the VideoLAN
Client. To activate it, use the `--vout aa' flag or select the `aa'
vout plugin from the preferences menu.
Package: vlc-xosd
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Description: X On-Screen Display plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This is an On-Screen Display plugin for vlc, the VideoLAN Client. To
activate it, use the `--intf xosd' flag or select the `xosd' interface
plugin from the preferences menu.
Package: mozilla-plugin-vlc
Architecture: any
Depends: vlc (= ${Source-Version}), mozilla, ${shlibs:Depends}
Description: a multimedia plugin for Mozilla, based on vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds support for MPEG, MPEG2, DVD and DivX to your Mozilla
browser. The decoding process is done by vlc and the output window is
embedded in a webpage or directly in the browser window. There is also
support for fullscreen display.
Package: vlc-kde
Architecture: any
Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
Provides: vlc-gui
Description: KDE interface plugin for vlc
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
.
This plugin adds a KDE interface to vlc, the VideoLAN Client. To
activate it, use the `--intf kde' flag or run the `kvlc' program.
......@@ -9,7 +9,7 @@
export DH_COMPAT=3
# Compilation options
export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi"
export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde"
# Remove --without-dvdcss here in non-totalitarian countries
export DVDCSS_FLAGS="--enable-dvd --without-dvdcss"
......@@ -55,19 +55,24 @@ install: build
# make symlinks for packages and install plugins
case $(DEB_BUILD_ARCH) in \
i386) \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa glide" ;; \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa xosd kde glide" ;; \
*) \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa" ;; \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa xosd kde" ;; \
esac ;\
for alias in $$ARCH_ALIASES ; do \
ln -s vlc debian/vlc-$$alias/usr/share/doc/vlc-$$alias ; \
mv debian/vlc/usr/lib/vlc/$$alias.so \
debian/vlc-$$alias/usr/lib/vlc/ ; done
# do the same for the mozilla plugin
ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
# move binary aliases
mv debian/vlc/usr/bin/gvlc debian/vlc-gtk/usr/bin/
mv debian/vlc/usr/bin/gnome-vlc debian/vlc-gnome/usr/bin/
mv debian/vlc/usr/bin/qvlc debian/vlc-qt/usr/bin/
#mv debian/vlc/usr/bin/kvlc debian/vlc-kde/usr/bin/
mv debian/vlc/usr/bin/kvlc debian/vlc-kde/usr/bin/
mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/vlc-gtk/$(VIDDIR)/gvlc.xpm
......@@ -76,8 +81,8 @@ install: build
mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/vlc-gnome/$(PIXDIR)/gnome-vlc.png
mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/vlc-qt/$(VIDDIR)/qvlc.xpm
mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/vlc-qt/$(PIXDIR)/qvlc.png
#mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/vlc-kde/$(VIDDIR)/kvlc.xpm
#mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/vlc-kde/$(PIXDIR)/kvlc.png
mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/vlc-kde/$(VIDDIR)/kvlc.xpm
mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/vlc-kde/$(PIXDIR)/kvlc.png
cp debian/vlc.desktop debian/vlc/$(GNOMEDIR)
cp debian/gvlc.desktop debian/vlc-gtk/$(GNOMEDIR)
......@@ -87,7 +92,7 @@ install: build
ln -s vlc.1.gz debian/vlc-gtk/usr/share/man/man1/gvlc.1.gz
ln -s vlc.1.gz debian/vlc-gnome/usr/share/man/man1/gnome-vlc.1.gz
ln -s vlc.1.gz debian/vlc-qt/usr/share/man/man1/qvlc.1.gz
#ln -s vlc.1.gz debian/vlc-kde/usr/share/man/man1/kvlc.1.gz
ln -s vlc.1.gz debian/vlc-kde/usr/share/man/man1/kvlc.1.gz
# Build architecture-independent files here.
binary-indep: build install
......@@ -109,7 +114,7 @@ binary-arch: build install
dh_installman doc/vlc.1
# dh_installinfo
# dh_undocumented
dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-alsa -Nvlc-sdl -Nvlc-qt -Nvlc-arts -Nvlc-mad -Nvlc-lirc -Nvlc-aa ChangeLog
dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-alsa -Nvlc-sdl -Nvlc-qt -Nvlc-arts -Nvlc-mad -Nvlc-lirc -Nvlc-aa -Nvlc-xosd -Nvlc-kde -Nmozilla-plugin-vlc ChangeLog
dh_link
dh_strip
dh_compress
......
###############################################################################
# vlc (VideoLAN Client) Mozilla plugin Makefile
# (c)2002 VideoLAN
###############################################################################
#
# Source objects
#
C_SRC = vlcplugin.c npunix.c
C_OBJ = $(C_SRC:%.c=%.o)
PLUGIN_OBJ = libvlcplugin.so
#
# Virtual targets
#
all: $(PLUGIN_OBJ)
clean:
rm -f *.o *.so
rm -Rf .dep
install:
mkdir -p $(DESTDIR)$(libdir)/mozilla/plugins
$(INSTALL) -m 644 $(PLUGIN_OBJ) $(DESTDIR)$(libdir)/mozilla/plugins
uninstall:
rm -f $(DESTDIR)$(libdir)/mozilla/plugins/$(PLUGIN_OBJ)
FORCE:
$(PLUGIN_OBJ): Makefile $(C_OBJ)
$(CC) -shared $(LDFLAGS) -L../lib $(mozilla_LDFLAGS) $(C_OBJ) -lvlc $(BUILTIN_OBJ:%=../%) $(builtins_LDFLAGS) -o $@
chmod a-x $@
$(C_OBJ): %.o: %.c
$(CC) $(CFLAGS) -I../include $(mozilla_CFLAGS) -c $< -o $@
/*
* npunix.c
*
* Netscape Client Plugin API
* - Wrapper function to interface with the Netscape Navigator
*
* dp Suresh <dp@netscape.com>
*
*----------------------------------------------------------------------
* PLUGIN DEVELOPERS:
* YOU WILL NOT NEED TO EDIT THIS FILE.
*----------------------------------------------------------------------
*/
#define XP_UNIX 1
#include <stdio.h>
#include "npapi.h"
#include "npupp.h"
/*
* Define PLUGIN_TRACE to have the wrapper functions print
* messages to stderr whenever they are called.
*/
#ifdef PLUGIN_TRACE
#include <stdio.h>
#define PLUGINDEBUGSTR(msg) fprintf(stderr, "%s\n", msg)
#else
#define PLUGINDEBUGSTR(msg)
#endif
/***********************************************************************
*
* Globals
*
***********************************************************************/
static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */
/***********************************************************************
*
* Wrapper functions : plugin calling Netscape Navigator
*
* 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;
/* Major version is in high byte */
*netscape_major = gNetscapeFuncs.version >> 8;
/* Minor version is in low byte */
*netscape_minor = gNetscapeFuncs.version & 0xFF;
}
NPError
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value)
{
return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
instance, variable, r_value);
}
NPError
NPN_GetURL(NPP instance, const char* url, const char* window)
{
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
}
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_ptr)
{
return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
type, window, stream_ptr);
}
int32
NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
{
return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
stream, len, buffer);
}
NPError
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
instance, stream, reason);
}
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);
}
void*
NPN_MemAlloc(uint32 size)
{
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
}
void NPN_MemFree(void* ptr)
{
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
}
uint32 NPN_MemFlush(uint32 size)
{
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
}
JRIEnv* NPN_GetJavaEnv()
{
return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv);
}
jref NPN_GetJavaPeer(NPP instance)
{
return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer,
instance);
}
/***********************************************************************
*
* Wrapper functions : Netscape Navigator -> 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_New(NPMIMEType pluginType, NPP instance, uint16 mode,
int16 argc, char* argn[], char* argv[], NPSavedData* saved)
{
NPError ret;
PLUGINDEBUGSTR("New");
ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
return ret;
}
NPError
Private_Destroy(NPP instance, NPSavedData** save)
{
PLUGINDEBUGSTR("Destroy");
return NPP_Destroy(instance, save);
}
NPError
Private_SetWindow(NPP instance, NPWindow* window)
{
NPError err;
PLUGINDEBUGSTR("SetWindow");
err = NPP_SetWindow(instance, window);
return err;
}
NPError
Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype)
{
NPError err;
PLUGINDEBUGSTR("NewStream");
err = NPP_NewStream(instance, type, stream, seekable, stype);
return err;
}
int32
Private_WriteReady(NPP instance, NPStream* stream)
{
unsigned int result;
PLUGINDEBUGSTR("WriteReady");
result = NPP_WriteReady(instance, stream);
return result;
}
int32
Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
void* buffer)
{
unsigned int result;
PLUGINDEBUGSTR("Write");
result = NPP_Write(instance, stream, offset, len, buffer);
return result;
}
void
Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
{
PLUGINDEBUGSTR("StreamAsFile");
NPP_StreamAsFile(instance, stream, fname);
}
NPError
Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
NPError err;
PLUGINDEBUGSTR("DestroyStream");
err = NPP_DestroyStream(instance, stream, reason);
return err;
}
void
Private_Print(NPP instance, NPPrint* platformPrint)
{
PLUGINDEBUGSTR("Print");
NPP_Print(instance, platformPrint);
}
JRIGlobalRef
Private_GetJavaClass(void)
{
jref clazz = NPP_GetJavaClass();
if (clazz) {
JRIEnv* env = NPN_GetJavaEnv();
return JRI_NewGlobalRef(env, clazz);
}
return NULL;
}
/***********************************************************************
*
* These functions are located automagically by netscape.
*
***********************************************************************/
/*
* NP_GetMIMEDescription
* - Netscape needs to know about this symbol
* - Netscape uses the return value to identify when an object instance
* of this plugin should be created.
*/
char *
NP_GetMIMEDescription(void)
{
return NPP_GetMIMEDescription();
}
/*
* NP_GetValue [optional]
* - Netscape needs to know about this symbol.
* - Interfaces with plugin to get values for predefined variables
* that the navigator needs.
*/
NPError
NP_GetValue(void *future, NPPVariable variable, void *value)
{
return NPP_GetValue(future, variable, value);
}
/*
* NP_Initialize
* - Netscape needs to know about this symbol.
* - It calls this function after looking up its symbol before it
* is about to create the first ever object of this kind.
*
* PARAMETERS
* nsTable - The netscape function table. If developers just use these
* wrappers, they dont need to worry about all these function
* tables.
* RETURN
* pluginFuncs
* - This functions needs to fill the plugin function table
* pluginFuncs and return it. Netscape Navigator plugin
* library will use this function table to call the plugin.
*
*/
NPError
NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
{
NPError err = NPERR_NO_ERROR;
PLUGINDEBUGSTR("NP_Initialize");
/* validate input parameters */
if ((nsTable == NULL) || (pluginFuncs == NULL))
err = NPERR_INVALID_FUNCTABLE_ERROR;
/*