rev 9165 - in branches/etch/packages/kdebase/debian: . patches
Fathi Boudra
fabo at alioth.debian.org
Sat Jan 26 16:49:50 UTC 2008
Author: fabo
Date: 2008-01-26 16:49:50 +0000 (Sat, 26 Jan 2008)
New Revision: 9165
Added:
branches/etch/packages/kdebase/debian/patches/01_nsplugins_branch_r764342.diff
branches/etch/packages/kdebase/debian/patches/01_nsplugins_regression_fix_branch_r757345.diff
branches/etch/packages/kdebase/debian/patches/01_nsplugins_viewer_64bit_fix_r764342.diff
Modified:
branches/etch/packages/kdebase/debian/changelog
branches/etch/packages/kdebase/debian/control
Log:
Prepare next stable release update:
* Add patch to support latest flash plugin. It consists of 2 parts patches.
This is the second part. First part is in kdelibs. (Closes: #455689)
* Add patch to fix regression in kcontrol administrator mode introduced by
the changes done in the flash plugin patch:
- Do not put kcontrol's own widgets inside of QXEmbed.
* Add nsplugins viewer 64bit fix.
Modified: branches/etch/packages/kdebase/debian/changelog
===================================================================
--- branches/etch/packages/kdebase/debian/changelog 2008-01-26 16:48:33 UTC (rev 9164)
+++ branches/etch/packages/kdebase/debian/changelog 2008-01-26 16:49:50 UTC (rev 9165)
@@ -1,3 +1,23 @@
+kdebase (4:3.5.5a.dfsg.1-6etch2) stable; urgency=low
+
+ * Add patch to support latest flash plugin. It consists of 2 parts patches.
+ This is the second part. First part is in kdelibs. (Closes: #455689)
+ * Add patch to fix regression in kcontrol administrator mode introduced by
+ the changes done in the flash plugin patch:
+ - Do not put kcontrol's own widgets inside of QXEmbed.
+ * Add nsplugins viewer 64bit fix.
+
+ -- Fathi Boudra <fabo at debian.org> Sat, 26 Jan 2008 16:19:16 +0100
+
+kdebase (4:3.5.5a.dfsg.1-6etch1) stable-security; urgency=high
+
+ * Non-maintainer upload by The Security Team.
+ * Under certain circumstances it might be possible for a user to
+ login to kdm without a password. This is now fixed.
+ [CVE-2007-4569]
+
+ -- Steve Kemp <skx at debian.org> Wed, 12 Sep 2007 13:27:21 +0000
+
kdebase (4:3.5.5a.dfsg.1-6) unstable; urgency=medium
+++ Changes by Sune Vuorela:
Modified: branches/etch/packages/kdebase/debian/control
===================================================================
--- branches/etch/packages/kdebase/debian/control 2008-01-26 16:48:33 UTC (rev 9164)
+++ branches/etch/packages/kdebase/debian/control 2008-01-26 16:49:50 UTC (rev 9165)
@@ -2,7 +2,7 @@
Section: kde
Priority: optional
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
-Uploaders: Isaac Clerencia <isaac at debian.org>, Pierre Habouzit <madcoder at debian.org>, Christopher Martin <chrsmrtn at debian.org>, Adeodato Simó <dato at net.com.org.es>, Ana Beatriz Guerrero Lopez <ana at debian.org>, Sune Vuorela <debian at pusling.com>, Fathi Boudra <fboudra at free.fr>, Josh Metzler <joshdeb at metzlers.org>
+Uploaders: Isaac Clerencia <isaac at debian.org>, Pierre Habouzit <madcoder at debian.org>, Christopher Martin <chrsmrtn at debian.org>, Adeodato Simó <dato at net.com.org.es>, Ana Beatriz Guerrero Lopez <ana at debian.org>, Sune Vuorela <debian at pusling.com>, Fathi Boudra <fabo at debian.org>, Josh Metzler <joshdeb at metzlers.org>
Build-Depends: cdbs (>= 0.4.39-0.1), debhelper (>= 5.0.31), autotools-dev, gawk, gettext, kdelibs4-dev (>= 4:3.5.5), libdbus-qt-1-dev (>= 0.60), libldap2-dev, libhal-dev (>= 0.5.5.1-2) [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libhal-storage-dev (>= 0.5.5.1-2) [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libncurses5-dev, libpam0g-dev, libpopt-dev, libraw1394-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libsensors-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libsmbclient-dev, libusb-dev, libxtst-dev, libfontenc-dev, libxss-dev, libxxf86misc-dev, libxcomposite-dev, libxdamage-dev, libxkbfile-dev, xutils, sharutils, texinfo, libavahi-compat-libdnssd-dev (>= 0.4)
Build-Depends-Indep: doxygen, qt3-doc, graphviz, gsfonts-x11, kdelibs4-doc
Build-Conflicts: nvidia-glx (<< 1.0.8774-6)
Added: branches/etch/packages/kdebase/debian/patches/01_nsplugins_branch_r764342.diff
===================================================================
--- branches/etch/packages/kdebase/debian/patches/01_nsplugins_branch_r764342.diff (rev 0)
+++ branches/etch/packages/kdebase/debian/patches/01_nsplugins_branch_r764342.diff 2008-01-26 16:49:50 UTC (rev 9165)
@@ -0,0 +1,5395 @@
+--- /dev/null
++++ b/nsplugins/sdk/prcpucfg.h
+@@ -0,0 +1,663 @@
++/* -*- Mode: C++; tab-width: 4; 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 the Netscape Portable Runtime (NSPR).
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998-2000
++ * 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 nspr_cpucfg___
++#define nspr_cpucfg___
++
++#ifndef XP_UNIX
++#define XP_UNIX
++#endif
++
++#ifndef LINUX
++#define LINUX
++#endif
++
++#define PR_AF_INET6 10 /* same as AF_INET6 */
++
++#ifdef __powerpc__
++
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__alpha)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__ia64__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__x86_64__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__mc68000__)
++
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 2
++#define PR_ALIGN_OF_LONG 2
++#define PR_ALIGN_OF_INT64 2
++#define PR_ALIGN_OF_FLOAT 2
++#define PR_ALIGN_OF_DOUBLE 2
++#define PR_ALIGN_OF_POINTER 2
++#define PR_ALIGN_OF_WORD 2
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__sparc__) || (defined(__SUNPRO_CC) && defined(__sparc))
++
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__i386__) || (defined(__SUNPRO_CC) && defined(__i386))
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 4
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__mips__)
++
++#ifdef __MIPSEB__
++#define IS_BIG_ENDIAN 1
++#undef IS_LITTLE_ENDIAN
++#elif defined(__MIPSEL__)
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#else
++#error "Unknown MIPS endianness."
++#endif
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__arm__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 4
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__hppa__)
++
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__s390x__)
++
++#define IS_BIG_ENDIAN 1
++#undef IS_LITTLE_ENDIAN
++#define IS_64
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 8
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 8
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 64
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 64
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 6
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 6
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 8
++#define PR_ALIGN_OF_INT64 8
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 8
++#define PR_ALIGN_OF_POINTER 8
++#define PR_ALIGN_OF_WORD 8
++
++#define PR_BYTES_PER_WORD_LOG2 3
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#elif defined(__s390__)
++
++#define IS_BIG_ENDIAN 1
++#undef IS_LITTLE_ENDIAN
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 4
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
++#else
++
++#error "Unknown CPU architecture"
++
++#endif
++
++#define HAVE_LONG_LONG 1
++#if PR_ALIGN_OF_DOUBLE == 8
++#define HAVE_ALIGNED_DOUBLES
++#endif
++#if PR_ALIGN_OF_INT64 == 8
++#define HAVE_ALIGNED_LONGLONGS
++#endif
++
++#ifndef NO_NSPR_10_SUPPORT
++
++#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
++#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
++#define BYTES_PER_INT PR_BYTES_PER_INT
++#define BYTES_PER_INT64 PR_BYTES_PER_INT64
++#define BYTES_PER_LONG PR_BYTES_PER_LONG
++#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
++#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
++#define BYTES_PER_WORD PR_BYTES_PER_WORD
++#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
++
++#define BITS_PER_BYTE PR_BITS_PER_BYTE
++#define BITS_PER_SHORT PR_BITS_PER_SHORT
++#define BITS_PER_INT PR_BITS_PER_INT
++#define BITS_PER_INT64 PR_BITS_PER_INT64
++#ifndef BITS_PER_LONG
++#define BITS_PER_LONG PR_BITS_PER_LONG
++#endif
++#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
++#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
++#define BITS_PER_WORD PR_BITS_PER_WORD
++
++#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
++#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
++#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
++#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
++#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
++#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
++#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
++#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
++
++#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
++#define ALIGN_OF_INT PR_ALIGN_OF_INT
++#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
++#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
++#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
++#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
++#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
++#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
++
++#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
++#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
++#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
++
++#endif /* NO_NSPR_10_SUPPORT */
++
++#endif /* nspr_cpucfg___ */
+--- a/nsplugins/sdk/jni_md.h
++++ b/nsplugins/sdk/jni_md.h
+@@ -1,41 +1,199 @@
+-/*
+- * @(#)jni_md.h 1.3 97/01/10
++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+- * Copyright (c) 1993-1996 Sun Microsystems, Inc. All Rights Reserved.
++ * ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+- * Permission to use, copy, modify, and distribute this software
+- * and its documentation for NON-COMMERCIAL purposes and without
+- * fee is hereby granted provided that this copyright notice
+- * appears in all copies.
+- *
+- * The Java source code is the confidential and proprietary information
+- * of Sun Microsystems, Inc. ("Confidential Information"). You shall
+- * not disclose such Confidential Information and shall use it only in
+- * accordance with the terms of the license agreement you entered into
+- * with Sun.
+- *
+- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
+- * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+- * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
+- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
++ * 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 *****
++ *
++ *
++ * This Original Code has been modified by IBM Corporation.
++ * Modifications made by IBM described herein are
++ * Copyright (c) International Business Machines
++ * Corporation, 2000
++ *
++ * Modifications to Mozilla code or documentation
++ * identified per MPL Section 3.3
++ *
++ * Date Modified by Description of modification
++ * 03/27/2000 IBM Corp. Set JNICALL to Optlink for
++ * use in OS2
+ */
+
++/*******************************************************************************
++ * Netscape version of jni_md.h -- depends on jri_md.h
++ ******************************************************************************/
++
+ #ifndef JNI_MD_H
+ #define JNI_MD_H
+
+-#include "jri_md.h"
++#include "prtypes.h" /* needed for _declspec */
+
+-#define JNICALL JRI_CALLBACK
++/*******************************************************************************
++ * WHAT'S UP WITH THIS FILE?
++ *
++ * This is where we define the mystical JNI_PUBLIC_API macro that works on all
++ * platforms. If you're running with Visual C++, Symantec C, or Borland's
++ * development environment on the PC, you're all set. Or if you're on the Mac
++ * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't
++ * matter.
++
++ * Changes by sailesh on 9/26
++
++ * There are two symbols used in the declaration of the JNI functions
++ * and native code that uses the JNI:
++ * JNICALL - specifies the calling convention
++ * JNIEXPORT - specifies export status of the function
++ *
++ * The syntax to specify calling conventions is different in Win16 and
++ * Win32 - the brains at Micro$oft at work here. JavaSoft in their
++ * infinite wisdom cares for no platform other than Win32, and so they
++ * just define these two symbols as:
++
++ #define JNIEXPORT __declspec(dllexport)
++ #define JNICALL __stdcall
++
++ * We deal with this, in the way JRI defines the JRI_PUBLIC_API, by
++ * defining a macro called JNI_PUBLIC_API. Any of our developers who
++ * wish to use code for Win16 and Win32, _must_ use JNI_PUBLIC_API to
++ * be able to export functions properly.
++
++ * Since we must also maintain compatibility with JavaSoft, we
++ * continue to define the symbol JNIEXPORT. However, use of this
++ * internally is deprecated, since it will cause a mess on Win16.
++
++ * We _do not_ need a new symbol called JNICALL. Instead we
++ * redefine JNICALL in the same way JRI_CALLBACK was defined.
++
++ ******************************************************************************/
++
++/* DLL Entry modifiers... */
++#if defined(XP_OS2)
++# ifdef XP_OS2_VACPP
++# define JNI_PUBLIC_API(ResultType) ResultType _System
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNICALL _Optlink
++# define JNIEXPORT
++# else
++# define JNI_PUBLIC_API(ResultType) ResultType
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNICALL
++# define JNIEXPORT
++# endif
++/* Win32 */
++#elif defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32)
++# include <windows.h>
++# if defined(_MSC_VER) || defined(__GNUC__)
++# if defined(WIN32) || defined(_WIN32)
++# define JNI_PUBLIC_API(ResultType) _declspec(dllexport) ResultType __stdcall
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) _declspec(dllexport) ResultType
++# define JNICALL __stdcall
++# else /* !_WIN32 */
++# if defined(_WINDLL)
++# define JNI_PUBLIC_API(ResultType) ResultType __cdecl __export __loadds
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) ResultType __cdecl __loadds
++# define JNICALL __loadds
++# else /* !WINDLL */
++# define JNI_PUBLIC_API(ResultType) ResultType __cdecl __export
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) ResultType __cdecl __export
++# define JNICALL __export
++# endif /* !WINDLL */
++# endif /* !_WIN32 */
++# elif defined(__BORLANDC__)
++# if defined(WIN32) || defined(_WIN32)
++# define JNI_PUBLIC_API(ResultType) __export ResultType
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) __export ResultType
++# define JNICALL
++# else /* !_WIN32 */
++# define JNI_PUBLIC_API(ResultType) ResultType _cdecl _export _loadds
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) ResultType _cdecl _loadds
++# define JNICALL _loadds
++# endif
++# else
++# error Unsupported PC development environment.
++# endif
++# ifndef IS_LITTLE_ENDIAN
++# define IS_LITTLE_ENDIAN
++# endif
++ /* This is the stuff inherited from JavaSoft .. */
++# define JNIEXPORT __declspec(dllexport)
++
++
++/* Mac */
++#elif defined(macintosh) || defined(Macintosh) || defined(THINK_C)
++# if defined(__MWERKS__) /* Metrowerks */
++# if !__option(enumsalwaysint)
++# error You need to define 'Enums Always Int' for your project.
++# endif
++# if defined(TARGET_CPU_68K) && !TARGET_RT_MAC_CFM
++# if !__option(fourbyteints)
++# error You need to define 'Struct Alignment: 68k' for your project.
++# endif
++# endif /* !GENERATINGCFM */
++# define JNI_PUBLIC_API(ResultType) __declspec(export) ResultType
++# define JNI_PUBLIC_VAR(VarType) JNI_PUBLIC_API(VarType)
++# define JNI_NATIVE_STUB(ResultType) JNI_PUBLIC_API(ResultType)
++# elif defined(__SC__) /* Symantec */
++# error What are the Symantec defines? (warren at netscape.com)
++# elif macintosh && applec /* MPW */
++# error Please upgrade to the latest MPW compiler (SC).
++# else
++# error Unsupported Mac development environment.
++# endif
++# define JNICALL
++ /* This is the stuff inherited from JavaSoft .. */
++# define JNIEXPORT
+
+-/* XXX don't use this -- it doesn't work for Win16 */
+-#ifdef XP_WIN
+-#define JNIEXPORT __declspec(dllexport)
++/* Unix or else */
+ #else
+-#define JNIEXPORT
++# define JNI_PUBLIC_API(ResultType) ResultType
++# define JNI_PUBLIC_VAR(VarType) VarType
++# define JNI_NATIVE_STUB(ResultType) ResultType
++# define JNICALL
++ /* This is the stuff inherited from JavaSoft .. */
++# define JNIEXPORT
+ #endif
+
++#ifndef FAR /* for non-Win16 */
++#define FAR
++#endif
+
++/* Get the rest of the stuff from jri_md.h */
++#include "jri_md.h"
+
+ #endif /* JNI_MD_H */
+--- /dev/null
++++ b/nsplugins/sdk/npruntime.h
+@@ -0,0 +1,399 @@
++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/*
++ * Copyright � 2004, Apple Computer, Inc. and The Mozilla Foundation.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
++ * Foundation ("Mozilla") nor the names of their contributors may be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
++ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
++ * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
++ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Revision 1 (March 4, 2004):
++ * Initial proposal.
++ *
++ * Revision 2 (March 10, 2004):
++ * All calls into script were made asynchronous. Results are
++ * provided via the NPScriptResultFunctionPtr callback.
++ *
++ * Revision 3 (March 10, 2004):
++ * Corrected comments to not refer to class retain/release FunctionPtrs.
++ *
++ * Revision 4 (March 11, 2004):
++ * Added additional convenience NPN_SetExceptionWithUTF8().
++ * Changed NPHasPropertyFunctionPtr and NPHasMethodFunctionPtr to take NPClass
++ * pointers instead of NPObject pointers.
++ * Added NPIsValidIdentifier().
++ *
++ * Revision 5 (March 17, 2004):
++ * Added context parameter to result callbacks from ScriptObject functions.
++ *
++ * Revision 6 (March 29, 2004):
++ * Renamed functions implemented by user agent to NPN_*. Removed _ from
++ * type names.
++ * Renamed "JavaScript" types to "Script".
++ *
++ * Revision 7 (April 21, 2004):
++ * NPIdentifier becomes a void*, was int32_t
++ * Remove NP_IsValidIdentifier, renamed NP_IdentifierFromUTF8 to NP_GetIdentifier
++ * Added NPVariant and modified functions to use this new type.
++ *
++ * Revision 8 (July 9, 2004):
++ * Updated to joint Apple-Mozilla license.
++ *
++ */
++#ifndef _NP_RUNTIME_H_
++#define _NP_RUNTIME_H_
++
++#include <qglobal.h>
++typedef Q_UINT32 uint32_t;
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/*
++ This API is used to facilitate binding code written in C to script
++ objects. The API in this header does not assume the presence of a
++ user agent. That is, it can be used to bind C code to scripting
++ environments outside of the context of a user agent.
++
++ However, the normal use of the this API is in the context of a
++ scripting environment running in a browser or other user agent.
++ In particular it is used to support the extended Netscape
++ script-ability API for plugins (NP-SAP). NP-SAP is an extension
++ of the Netscape plugin API. As such we have adopted the use of
++ the "NP" prefix for this API.
++
++ The following NP{N|P}Variables were added to the Netscape plugin
++ API (in npapi.h):
++
++ NPNVWindowNPObject
++ NPNVPluginElementNPObject
++ NPPVpluginScriptableNPObject
++
++ These variables are exposed through NPN_GetValue() and
++ NPP_GetValue() (respectively) and are used to establish the
++ initial binding between the user agent and native code. The DOM
++ objects in the user agent can be examined and manipulated using
++ the NPN_ functions that operate on NPObjects described in this
++ header.
++
++ To the extent possible the assumptions about the scripting
++ language used by the scripting environment have been minimized.
++*/
++
++#define NP_BEGIN_MACRO do {
++#define NP_END_MACRO } while (0)
++
++/*
++ Objects (non-primitive data) passed between 'C' and script is
++ always wrapped in an NPObject. The 'interface' of an NPObject is
++ described by an NPClass.
++*/
++typedef struct NPObject NPObject;
++typedef struct NPClass NPClass;
++
++typedef char NPUTF8;
++typedef struct _NPString {
++ const NPUTF8 *utf8characters;
++ uint32_t utf8length;
++} NPString;
++
++typedef enum {
++ NPVariantType_Void,
++ NPVariantType_Null,
++ NPVariantType_Bool,
++ NPVariantType_Int32,
++ NPVariantType_Double,
++ NPVariantType_String,
++ NPVariantType_Object
++} NPVariantType;
++
++typedef struct _NPVariant {
++ NPVariantType type;
++ union {
++ bool boolValue;
++ uint32_t intValue;
++ double doubleValue;
++ NPString stringValue;
++ NPObject *objectValue;
++ } value;
++} NPVariant;
++
++/*
++ NPN_ReleaseVariantValue is called on all 'out' parameters
++ references. Specifically it is to be called on variants that own
++ their value, as is the case with all non-const NPVariant*
++ arguments after a successful call to any methods (except this one)
++ in this API.
++
++ After calling NPN_ReleaseVariantValue, the type of the variant
++ will be NPVariantType_Void.
++*/
++void NPN_ReleaseVariantValue(NPVariant *variant);
++
++#define NPVARIANT_IS_VOID(_v) ((_v).type == NPVariantType_Void)
++#define NPVARIANT_IS_NULL(_v) ((_v).type == NPVariantType_Null)
++#define NPVARIANT_IS_BOOLEAN(_v) ((_v).type == NPVariantType_Bool)
++#define NPVARIANT_IS_INT32(_v) ((_v).type == NPVariantType_Int32)
++#define NPVARIANT_IS_DOUBLE(_v) ((_v).type == NPVariantType_Double)
++#define NPVARIANT_IS_STRING(_v) ((_v).type == NPVariantType_String)
++#define NPVARIANT_IS_OBJECT(_v) ((_v).type == NPVariantType_Object)
++
++#define NPVARIANT_TO_BOOLEAN(_v) ((_v).value.boolValue)
++#define NPVARIANT_TO_INT32(_v) ((_v).value.intValue)
++#define NPVARIANT_TO_DOUBLE(_v) ((_v).value.doubleValue)
++#define NPVARIANT_TO_STRING(_v) ((_v).value.stringValue)
++#define NPVARIANT_TO_OBJECT(_v) ((_v).value.objectValue)
++
++#define VOID_TO_NPVARIANT(_v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Void; \
++ (_v).value.objectValue = NULL; \
++NP_END_MACRO
++
++#define NULL_TO_NPVARIANT(_v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Null; \
++ (_v).value.objectValue = NULL; \
++NP_END_MACRO
++
++#define BOOLEAN_TO_NPVARIANT(_val, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Bool; \
++ (_v).value.boolValue = !!(_val); \
++NP_END_MACRO
++
++#define INT32_TO_NPVARIANT(_val, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Int32; \
++ (_v).value.intValue = _val; \
++NP_END_MACRO
++
++#define DOUBLE_TO_NPVARIANT(_val, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Double; \
++ (_v).value.doubleValue = _val; \
++NP_END_MACRO
++
++#define STRINGZ_TO_NPVARIANT(_val, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_String; \
++ NPString str = { _val, strlen(_val) }; \
++ (_v).value.stringValue = str; \
++NP_END_MACRO
++
++#define STRINGN_TO_NPVARIANT(_val, _len, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_String; \
++ NPString str = { _val, _len }; \
++ (_v).value.stringValue = str; \
++NP_END_MACRO
++
++#define OBJECT_TO_NPVARIANT(_val, _v) \
++NP_BEGIN_MACRO \
++ (_v).type = NPVariantType_Object; \
++ (_v).value.objectValue = _val; \
++NP_END_MACRO
++
++
++/*
++ Type mappings (JavaScript types have been used for illustration
++ purposes):
++
++ JavaScript to C (NPVariant with type:)
++ undefined NPVariantType_Void
++ null NPVariantType_Null
++ Boolean NPVariantType_Bool
++ Number NPVariantType_Double or NPVariantType_Int32
++ String NPVariantType_String
++ Object NPVariantType_Object
++
++ C (NPVariant with type:) to JavaScript
++ NPVariantType_Void undefined
++ NPVariantType_Null null
++ NPVariantType_Bool Boolean
++ NPVariantType_Int32 Number
++ NPVariantType_Double Number
++ NPVariantType_String String
++ NPVariantType_Object Object
++*/
++
++typedef void *NPIdentifier;
++
++/*
++ NPObjects have methods and properties. Methods and properties are
++ identified with NPIdentifiers. These identifiers may be reflected
++ in script. NPIdentifiers can be either strings or integers, IOW,
++ methods and properties can be identified by either strings or
++ integers (i.e. foo["bar"] vs foo[1]). NPIdentifiers can be
++ compared using ==. In case of any errors, the requested
++ NPIdentifier(s) will be NULL.
++*/
++NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name);
++void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
++ NPIdentifier *identifiers);
++NPIdentifier NPN_GetIntIdentifier(int32_t intid);
++bool NPN_IdentifierIsString(NPIdentifier identifier);
++
++/*
++ The NPUTF8 returned from NPN_UTF8FromIdentifier SHOULD be freed.
++*/
++NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier);
++
++/*
++ Get the integer represented by identifier. If identifier is not an
++ integer identifier, the behaviour is undefined.
++*/
++int32_t NPN_IntFromIdentifier(NPIdentifier identifier);
++
++/*
++ NPObject behavior is implemented using the following set of
++ callback functions.
++
++ The NPVariant *result argument of these functions (where
++ applicable) should be released using NPN_ReleaseVariantValue().
++*/
++typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass);
++typedef void (*NPDeallocateFunctionPtr)(NPObject *npobj);
++typedef void (*NPInvalidateFunctionPtr)(NPObject *npobj);
++typedef bool (*NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name);
++typedef bool (*NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name,
++ const NPVariant *args, uint32_t argCount,
++ NPVariant *result);
++typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject *npobj,
++ const NPVariant *args,
++ uint32_t argCount,
++ NPVariant *result);
++typedef bool (*NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name);
++typedef bool (*NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
++ NPVariant *result);
++typedef bool (*NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
++ const NPVariant *value);
++typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj,
++ NPIdentifier name);
++
++/*
++ NPObjects returned by create, retain, invoke, and getProperty pass
++ a reference count to the caller. That is, the callee adds a
++ reference count which passes to the caller. It is the caller's
++ responsibility to release the returned object.
++
++ NPInvokeFunctionPtr function may return 0 to indicate a void
++ result.
++
++ NPInvalidateFunctionPtr is called by the scripting environment
++ when the native code is shutdown. Any attempt to message a
++ NPObject instance after the invalidate callback has been
++ called will result in undefined behavior, even if the native code
++ is still retaining those NPObject instances. (The runtime
++ will typically return immediately, with 0 or NULL, from an attempt
++ to dispatch to a NPObject, but this behavior should not be
++ depended upon.)
++*/
++struct NPClass
++{
++ uint32_t structVersion;
++ NPAllocateFunctionPtr allocate;
++ NPDeallocateFunctionPtr deallocate;
++ NPInvalidateFunctionPtr invalidate;
++ NPHasMethodFunctionPtr hasMethod;
++ NPInvokeFunctionPtr invoke;
++ NPInvokeDefaultFunctionPtr invokeDefault;
++ NPHasPropertyFunctionPtr hasProperty;
++ NPGetPropertyFunctionPtr getProperty;
++ NPSetPropertyFunctionPtr setProperty;
++ NPRemovePropertyFunctionPtr removeProperty;
++};
++
++#define NP_CLASS_STRUCT_VERSION 1
++
++struct NPObject {
++ NPClass *_class;
++ uint32_t referenceCount;
++ /*
++ * Additional space may be allocated here by types of NPObjects
++ */
++};
++
++/*
++ If the class has an allocate function, NPN_CreateObject invokes
++ that function, otherwise a NPObject is allocated and
++ returned. This method will initialize the referenceCount member of
++ the NPObject to 1.
++*/
++NPObject *NPN_CreateObject(NPP npp, NPClass *aClass);
++
++/*
++ Increment the NPObject's reference count.
++*/
++NPObject *NPN_RetainObject(NPObject *npobj);
++
++/*
++ Decremented the NPObject's reference count. If the reference
++ count goes to zero, the class's destroy function is invoke if
++ specified, otherwise the object is freed directly.
++*/
++void NPN_ReleaseObject(NPObject *npobj);
++
++/*
++ Functions to access script objects represented by NPObject.
++
++ Calls to script objects are synchronous. If a function returns a
++ value, it will be supplied via the result NPVariant
++ argument. Successful calls will return true, false will be
++ returned in case of an error.
++
++ Calls made from plugin code to script must be made from the thread
++ on which the plugin was initialized.
++*/
++
++bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
++ const NPVariant *args, uint32_t argCount, NPVariant *result);
++bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
++ uint32_t argCount, NPVariant *result);
++bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
++ NPVariant *result);
++bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
++ NPVariant *result);
++bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
++ const NPVariant *value);
++bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
++bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
++bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
++
++/*
++ NPN_SetException may be called to trigger a script exception upon
++ return from entry points into NPObjects. Typical usage:
++
++ NPN_SetException (npobj, message);
++*/
++void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- a/nsplugins/sdk/npupp.h
++++ b/nsplugins/sdk/npupp.h
+@@ -1,6 +1,43 @@
+-/* -*- Mode: C; tab-width: 4; -*- */
++/* -*- 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 ***** */
++
++
+ /*
+- * npupp.h $Revision: 46100 $
++ * npupp.h
+ * function call mecahnics needed by platform specific glue code.
+ */
+
+@@ -8,6 +45,10 @@
+ #ifndef _NPUPP_H_
+ #define _NPUPP_H_
+
++#if defined(__OS2__)
++#pragma pack(1)
++#endif
++
+ #ifndef GENERATINGCFM
+ #define GENERATINGCFM 0
+ #endif
+@@ -16,435 +57,437 @@
+ #include "npapi.h"
+ #endif
+
++#include "npruntime.h"
++
+ #include "jri.h"
+
+ /******************************************************************************************
+ plug-in function table macros
+- for each function in and out of the plugin API we define
++ for each function in and out of the plugin API we define
+ typedef NPP_FooUPP
+- #define NewNPP_FooProc
+- #define CallNPP_FooProc
+- for mac, define the UPP magic for PPC/68K calling
++ #define NewNPP_FooProc
++ #define CallNPP_FooProc
++ for mac, define the UPP magic for PPC/68K calling
+ *******************************************************************************************/
+
+
+ /* NPP_Initialize */
+
+-#if GENERATINGCFM
++#define _NPUPP_USE_UPP_ 0
++
++#if _NPUPP_USE_UPP_
+ typedef UniversalProcPtr NPP_InitializeUPP;
+
+ enum {
+- uppNPP_InitializeProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
+- | RESULT_SIZE(SIZE_CODE(0))
+-};
+-
+-#define NewNPP_InitializeProc(FUNC) \
+- (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
+-#define CallNPP_InitializeProc(FUNC) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
+-
+-#else
+-
+-typedef void (*NPP_InitializeUPP)(void);
+-#define NewNPP_InitializeProc(FUNC) \
+- ((NPP_InitializeUPP) (FUNC))
+-#define CallNPP_InitializeProc(FUNC) \
+- (*(FUNC))()
++ uppNPP_InitializeProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPP_InitializeProc(FUNC) \
++ (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
++#define CallNPP_InitializeProc(FUNC) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
++
++#else
++
++typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
++#define NewNPP_InitializeProc(FUNC) \
++ ((NPP_InitializeUPP) (FUNC))
++#define CallNPP_InitializeProc(FUNC) \
++ (*(FUNC))()
+
+ #endif
+
+
+ /* NPP_Shutdown */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+ typedef UniversalProcPtr NPP_ShutdownUPP;
+
+ enum {
+- uppNPP_ShutdownProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
+- | RESULT_SIZE(SIZE_CODE(0))
+-};
+-
+-#define NewNPP_ShutdownProc(FUNC) \
+- (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
+-#define CallNPP_ShutdownProc(FUNC) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
+-
+-#else
+-
+-typedef void (*NPP_ShutdownUPP)(void);
+-#define NewNPP_ShutdownProc(FUNC) \
+- ((NPP_ShutdownUPP) (FUNC))
+-#define CallNPP_ShutdownProc(FUNC) \
+- (*(FUNC))()
++ uppNPP_ShutdownProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPP_ShutdownProc(FUNC) \
++ (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
++#define CallNPP_ShutdownProc(FUNC) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
++
++#else
++
++typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
++#define NewNPP_ShutdownProc(FUNC) \
++ ((NPP_ShutdownUPP) (FUNC))
++#define CallNPP_ShutdownProc(FUNC) \
++ (*(FUNC))()
+
+ #endif
+
+
+ /* NPP_New */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+ typedef UniversalProcPtr NPP_NewUPP;
+
+ enum {
+- uppNPP_NewProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
+- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
+- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
+- | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPP_NewProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
++ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
++ | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+
+-#define NewNPP_NewProc(FUNC) \
+- (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
++#define NewNPP_NewProc(FUNC) \
++ (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
+ #define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
+- (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
++ (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+ #else
+
+-typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
+-#define NewNPP_NewProc(FUNC) \
+- ((NPP_NewUPP) (FUNC))
+-#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
++typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
++#define NewNPP_NewProc(FUNC) \
++ ((NPP_NewUPP) (FUNC))
++#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+
+ #endif
+
+
+ /* NPP_Destroy */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_DestroyUPP;
+ enum {
+- uppNPP_DestroyProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPP_DestroyProc(FUNC) \
+- (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
+-#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
+-#else
+-
+-typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save);
+-#define NewNPP_DestroyProc(FUNC) \
+- ((NPP_DestroyUPP) (FUNC))
+-#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
+- (*(FUNC))((ARG1), (ARG2))
++ uppNPP_DestroyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPP_DestroyProc(FUNC) \
++ (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
++#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
++#else
++
++typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
++#define NewNPP_DestroyProc(FUNC) \
++ ((NPP_DestroyUPP) (FUNC))
++#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
+
+ #endif
+
+
+ /* NPP_SetWindow */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_SetWindowUPP;
+ enum {
+- uppNPP_SetWindowProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPP_SetWindowProc(FUNC) \
+- (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
+-#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
++ uppNPP_SetWindowProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPP_SetWindowProc(FUNC) \
++ (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
++#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
+
+ #else
+
+-typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window);
+-#define NewNPP_SetWindowProc(FUNC) \
+- ((NPP_SetWindowUPP) (FUNC))
+-#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
+- (*(FUNC))((ARG1), (ARG2))
++typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
++#define NewNPP_SetWindowProc(FUNC) \
++ ((NPP_SetWindowUPP) (FUNC))
++#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
+
+ #endif
+
+
+ /* NPP_NewStream */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_NewStreamUPP;
+ enum {
+- uppNPP_NewStreamProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
+- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPP_NewStreamProc(FUNC) \
+- (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
+-#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+-#else
+-
+-typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
+-#define NewNPP_NewStreamProc(FUNC) \
+- ((NPP_NewStreamUPP) (FUNC))
++ uppNPP_NewStreamProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPP_NewStreamProc(FUNC) \
++ (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
++#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
++#else
++
++typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
++#define NewNPP_NewStreamProc(FUNC) \
++ ((NPP_NewStreamUPP) (FUNC))
+ #define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+ #endif
+
+
+ /* NPP_DestroyStream */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_DestroyStreamUPP;
+ enum {
+- uppNPP_DestroyStreamProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPP_DestroyStreamProc(FUNC) \
+- (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
+-#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
++ uppNPP_DestroyStreamProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPP_DestroyStreamProc(FUNC) \
++ (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
++#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
+
+ #else
+
+-typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
+-#define NewNPP_DestroyStreamProc(FUNC) \
+- ((NPP_DestroyStreamUPP) (FUNC))
+-#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
+- (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
++typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
++#define NewNPP_DestroyStreamProc(FUNC) \
++ ((NPP_DestroyStreamUPP) (FUNC))
++#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
++ (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
+
+ #endif
+
+
+ /* NPP_WriteReady */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_WriteReadyUPP;
+ enum {
+- uppNPP_WriteReadyProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
+-};
+-#define NewNPP_WriteReadyProc(FUNC) \
+- (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
+-#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
+- (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
++ uppNPP_WriteReadyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
++};
++#define NewNPP_WriteReadyProc(FUNC) \
++ (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
++#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
++ (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
+
+ #else
+
+-typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
+-#define NewNPP_WriteReadyProc(FUNC) \
+- ((NPP_WriteReadyUPP) (FUNC))
+-#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
+- (*(FUNC))((NPParg), (NPStreamPtr))
++typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
++#define NewNPP_WriteReadyProc(FUNC) \
++ ((NPP_WriteReadyUPP) (FUNC))
++#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
++ (*(FUNC))((NPParg), (NPStreamPtr))
+
+ #endif
+
+
+ /* NPP_Write */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_WriteUPP;
+ enum {
+- uppNPP_WriteProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
+- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
+-};
+-#define NewNPP_WriteProc(FUNC) \
+- (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
+-#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
+- (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
++ uppNPP_WriteProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
++};
++#define NewNPP_WriteProc(FUNC) \
++ (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
++#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
++ (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
+
+ #else
+
+-typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
+-#define NewNPP_WriteProc(FUNC) \
+- ((NPP_WriteUPP) (FUNC))
+-#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
+- (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
++typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
++#define NewNPP_WriteProc(FUNC) \
++ ((NPP_WriteUPP) (FUNC))
++#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
++ (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
+
+ #endif
+
+
+ /* NPP_StreamAsFile */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_StreamAsFileUPP;
+ enum {
+- uppNPP_StreamAsFileProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
+- | RESULT_SIZE(SIZE_CODE(0))
+-};
+-#define NewNPP_StreamAsFileProc(FUNC) \
+- (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
+-#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
++ uppNPP_StreamAsFileProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++#define NewNPP_StreamAsFileProc(FUNC) \
++ (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
++#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
+
+ #else
+
+-typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
+-#define NewNPP_StreamAsFileProc(FUNC) \
+- ((NPP_StreamAsFileUPP) (FUNC))
+-#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
++#define NewNPP_StreamAsFileProc(FUNC) \
++ ((NPP_StreamAsFileUPP) (FUNC))
++#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+ /* NPP_Print */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_PrintUPP;
+ enum {
+- uppNPP_PrintProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
+- | RESULT_SIZE(SIZE_CODE(0))
+-};
+-#define NewNPP_PrintProc(FUNC) \
+- (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
+-#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
++ uppNPP_PrintProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++#define NewNPP_PrintProc(FUNC) \
++ (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
++#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
+
+ #else
+
+-typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
+-#define NewNPP_PrintProc(FUNC) \
+- ((NPP_PrintUPP) (FUNC))
+-#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
+- (*(FUNC))((NPParg), (NPPrintArg))
++typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
++#define NewNPP_PrintProc(FUNC) \
++ ((NPP_PrintUPP) (FUNC))
++#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
++ (*(FUNC))((NPParg), (NPPrintArg))
+
+ #endif
+
+
+ /* NPP_HandleEvent */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_HandleEventUPP;
+ enum {
+- uppNPP_HandleEventProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(int16)))
+-};
+-#define NewNPP_HandleEventProc(FUNC) \
+- (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
+-#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
+- (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
++ uppNPP_HandleEventProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(int16)))
++};
++#define NewNPP_HandleEventProc(FUNC) \
++ (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
++#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
++ (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
+
+ #else
+
+-typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event);
+-#define NewNPP_HandleEventProc(FUNC) \
+- ((NPP_HandleEventUPP) (FUNC))
+-#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
+- (*(FUNC))((NPParg), (voidPtr))
++typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
++#define NewNPP_HandleEventProc(FUNC) \
++ ((NPP_HandleEventUPP) (FUNC))
++#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
++ (*(FUNC))((NPParg), (voidPtr))
+
+ #endif
+
+
+ /* NPP_URLNotify */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_URLNotifyUPP;
+ enum {
+- uppNPP_URLNotifyProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+- | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
+-};
+-#define NewNPP_URLNotifyProc(FUNC) \
+- (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
+-#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
++ uppNPP_URLNotifyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
++ | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
++};
++#define NewNPP_URLNotifyProc(FUNC) \
++ (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
++#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
+
+ #else
+
+-typedef void (*NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
+-#define NewNPP_URLNotifyProc(FUNC) \
+- ((NPP_URLNotifyUPP) (FUNC))
+-#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
++typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
++#define NewNPP_URLNotifyProc(FUNC) \
++ ((NPP_URLNotifyUPP) (FUNC))
++#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
+
+ #endif
+
+
+ /* NPP_GetValue */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_GetValueUPP;
+ enum {
+- uppNPP_GetValueProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPP_GetValueProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPP_GetValueProc(FUNC) \
+- (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
++#define NewNPP_GetValueProc(FUNC) \
++ (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
+ #define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
+ #else
+
+-typedef NPError (*NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
+-#define NewNPP_GetValueProc(FUNC) \
+- ((NPP_GetValueUPP) (FUNC))
+-#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
++#define NewNPP_GetValueProc(FUNC) \
++ ((NPP_GetValueUPP) (FUNC))
++#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+ /* NPP_SetValue */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_SetValueUPP;
+ enum {
+- uppNPP_SetValueProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPP_SetValueProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPP_SetValueProc(FUNC) \
+- (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
++#define NewNPP_SetValueProc(FUNC) \
++ (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
+ #define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
+ #else
+
+-typedef NPError (*NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
+-#define NewNPP_SetValueProc(FUNC) \
+- ((NPP_SetValueUPP) (FUNC))
+-#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
++#define NewNPP_SetValueProc(FUNC) \
++ ((NPP_SetValueUPP) (FUNC))
++#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+-
+-
+ /*
+ * Netscape entry points
+ */
+@@ -452,310 +495,310 @@
+
+ /* NPN_GetValue */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_GetValueUPP;
+ enum {
+- uppNPN_GetValueProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_GetValueProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_GetValueProc(FUNC) \
+- (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
++#define NewNPN_GetValueProc(FUNC) \
++ (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
+ #define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
+ #else
+
+-typedef NPError (*NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
+-#define NewNPN_GetValueProc(FUNC) \
+- ((NPN_GetValueUPP) (FUNC))
+-#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
++#define NewNPN_GetValueProc(FUNC) \
++ ((NPN_GetValueUPP) (FUNC))
++#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+ /* NPN_SetValue */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_SetValueUPP;
+ enum {
+- uppNPN_SetValueProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_SetValueProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_SetValueProc(FUNC) \
+- (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
++#define NewNPN_SetValueProc(FUNC) \
++ (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
+ #define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
+ #else
+
+-typedef NPError (*NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
+-#define NewNPN_SetValueProc(FUNC) \
+- ((NPN_SetValueUPP) (FUNC))
+-#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
++#define NewNPN_SetValueProc(FUNC) \
++ ((NPN_SetValueUPP) (FUNC))
++#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+ /* NPN_GetUrlNotify */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_GetURLNotifyUPP;
+ enum {
+- uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_GetURLNotifyProc(FUNC) \
+- (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
++#define NewNPN_GetURLNotifyProc(FUNC) \
++ (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
+ #define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
+ #else
+
+-typedef NPError (*NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
+-#define NewNPN_GetURLNotifyProc(FUNC) \
+- ((NPN_GetURLNotifyUPP) (FUNC))
+-#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
++typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
++#define NewNPN_GetURLNotifyProc(FUNC) \
++ ((NPN_GetURLNotifyUPP) (FUNC))
++#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
+ #endif
+
+
+ /* NPN_PostUrlNotify */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_PostURLNotifyUPP;
+ enum {
+- uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
+- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
+- | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
++ | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_PostURLNotifyProc(FUNC) \
+- (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
++#define NewNPN_PostURLNotifyProc(FUNC) \
++ (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
+ #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+ #else
+
+-typedef NPError (*NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
+-#define NewNPN_PostURLNotifyProc(FUNC) \
+- ((NPN_PostURLNotifyUPP) (FUNC))
++typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
++#define NewNPN_PostURLNotifyProc(FUNC) \
++ ((NPN_PostURLNotifyUPP) (FUNC))
+ #define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+ #endif
+
+
+ /* NPN_GetUrl */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_GetURLUPP;
+ enum {
+- uppNPN_GetURLProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_GetURLProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_GetURLProc(FUNC) \
+- (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
++#define NewNPN_GetURLProc(FUNC) \
++ (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
+ #define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
+ #else
+
+-typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
+-#define NewNPN_GetURLProc(FUNC) \
+- ((NPN_GetURLUPP) (FUNC))
+-#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3))
++typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
++#define NewNPN_GetURLProc(FUNC) \
++ ((NPN_GetURLUPP) (FUNC))
++#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
+ #endif
+
+
+ /* NPN_PostUrl */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_PostURLUPP;
+ enum {
+- uppNPN_PostURLProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
+- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
+- | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++ uppNPN_PostURLProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
++ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+ };
+-#define NewNPN_PostURLProc(FUNC) \
+- (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
++#define NewNPN_PostURLProc(FUNC) \
++ (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
+ #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
+ #else
+
+-typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
+-#define NewNPN_PostURLProc(FUNC) \
+- ((NPN_PostURLUPP) (FUNC))
++typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
++#define NewNPN_PostURLProc(FUNC) \
++ ((NPN_PostURLUPP) (FUNC))
+ #define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
+- (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
+ #endif
+
+
+ /* NPN_RequestRead */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_RequestReadUPP;
+ enum {
+- uppNPN_RequestReadProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPN_RequestReadProc(FUNC) \
+- (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
+-#define CallNPN_RequestReadProc(FUNC, stream, range) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
++ uppNPN_RequestReadProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPN_RequestReadProc(FUNC) \
++ (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
++#define CallNPN_RequestReadProc(FUNC, stream, range) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
+
+ #else
+
+-typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
+-#define NewNPN_RequestReadProc(FUNC) \
+- ((NPN_RequestReadUPP) (FUNC))
+-#define CallNPN_RequestReadProc(FUNC, stream, range) \
+- (*(FUNC))((stream), (range))
++typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
++#define NewNPN_RequestReadProc(FUNC) \
++ ((NPN_RequestReadUPP) (FUNC))
++#define CallNPN_RequestReadProc(FUNC, stream, range) \
++ (*(FUNC))((stream), (range))
+
+ #endif
+
+
+ /* NPN_NewStream */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_NewStreamUPP;
+ enum {
+- uppNPN_NewStreamProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPN_NewStreamProc(FUNC) \
+- (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
+-#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream))
++ uppNPN_NewStreamProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPN_NewStreamProc(FUNC) \
++ (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
++#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream))
+
+ #else
+
+-typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
+-#define NewNPN_NewStreamProc(FUNC) \
+- ((NPN_NewStreamUPP) (FUNC))
+-#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
+- (*(FUNC))((npp), (type), (window), (stream))
++typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
++#define NewNPN_NewStreamProc(FUNC) \
++ ((NPN_NewStreamUPP) (FUNC))
++#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
++ (*(FUNC))((npp), (type), (window), (stream))
+
+ #endif
+
+
+ /* NPN_Write */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_WriteUPP;
+ enum {
+- uppNPN_WriteProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
+- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
+-};
+-#define NewNPN_WriteProc(FUNC) \
+- (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
+-#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
+- (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))
++ uppNPN_WriteProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(int32)))
++};
++#define NewNPN_WriteProc(FUNC) \
++ (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
++#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
++ (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))
+
+ #else
+
+-typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
+-#define NewNPN_WriteProc(FUNC) \
+- ((NPN_WriteUPP) (FUNC))
+-#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
+- (*(FUNC))((npp), (stream), (len), (buffer))
++typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
++#define NewNPN_WriteProc(FUNC) \
++ ((NPN_WriteUPP) (FUNC))
++#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
++ (*(FUNC))((npp), (stream), (len), (buffer))
+
+ #endif
+
+
+ /* NPN_DestroyStream */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_DestroyStreamUPP;
+ enum {
+- uppNPN_DestroyStreamProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPN_DestroyStreamProc(FUNC) \
+- (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
+-#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
+- (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason))
++ uppNPN_DestroyStreamProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPN_DestroyStreamProc(FUNC) \
++ (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
++#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
++ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason))
+
+ #else
+
+-typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
+-#define NewNPN_DestroyStreamProc(FUNC) \
+- ((NPN_DestroyStreamUPP) (FUNC))
+-#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
+- (*(FUNC))((npp), (stream), (reason))
++typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
++#define NewNPN_DestroyStreamProc(FUNC) \
++ ((NPN_DestroyStreamUPP) (FUNC))
++#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
++ (*(FUNC))((npp), (stream), (reason))
+
+ #endif
+
+
+ /* NPN_Status */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_StatusUPP;
+ enum {
+- uppNPN_StatusProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
++ uppNPN_StatusProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
+ };
+
+-#define NewNPN_StatusProc(FUNC) \
+- (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
+-#define CallNPN_StatusProc(FUNC, npp, msg) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))
++#define NewNPN_StatusProc(FUNC) \
++ (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
++#define CallNPN_StatusProc(FUNC, npp, msg) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))
+
+ #else
+
+-typedef void (*NPN_StatusUPP)(NPP instance, const char* message);
+-#define NewNPN_StatusProc(FUNC) \
+- ((NPN_StatusUPP) (FUNC))
+-#define CallNPN_StatusProc(FUNC, npp, msg) \
+- (*(FUNC))((npp), (msg))
++typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
++#define NewNPN_StatusProc(FUNC) \
++ ((NPN_StatusUPP) (FUNC))
++#define CallNPN_StatusProc(FUNC, npp, msg) \
++ (*(FUNC))((npp), (msg))
+
+ #endif
+
+
+ /* NPN_UserAgent */
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_UserAgentUPP;
+ enum {
+@@ -771,7 +814,7 @@
+
+ #else
+
+-typedef const char* (*NPN_UserAgentUPP)(NPP instance);
++typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
+ #define NewNPN_UserAgentProc(FUNC) \
+ ((NPN_UserAgentUPP) (FUNC))
+ #define CallNPN_UserAgentProc(FUNC, ARG1) \
+@@ -781,80 +824,80 @@
+
+
+ /* NPN_MemAlloc */
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_MemAllocUPP;
+ enum {
+- uppNPN_MemAllocProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
++ uppNPN_MemAllocProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
+ };
+
+-#define NewNPN_MemAllocProc(FUNC) \
+- (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
+-#define CallNPN_MemAllocProc(FUNC, ARG1) \
+- (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1))
++#define NewNPN_MemAllocProc(FUNC) \
++ (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
++#define CallNPN_MemAllocProc(FUNC, ARG1) \
++ (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1))
+
+ #else
+
+-typedef void* (*NPN_MemAllocUPP)(uint32 size);
+-#define NewNPN_MemAllocProc(FUNC) \
+- ((NPN_MemAllocUPP) (FUNC))
+-#define CallNPN_MemAllocProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
++#define NewNPN_MemAllocProc(FUNC) \
++ ((NPN_MemAllocUPP) (FUNC))
++#define CallNPN_MemAllocProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
+
+ #endif
+
+
+ /* NPN__MemFree */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_MemFreeUPP;
+ enum {
+- uppNPN_MemFreeProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
++ uppNPN_MemFreeProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
+ };
+
+-#define NewNPN_MemFreeProc(FUNC) \
+- (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
+-#define CallNPN_MemFreeProc(FUNC, ARG1) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
++#define NewNPN_MemFreeProc(FUNC) \
++ (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
++#define CallNPN_MemFreeProc(FUNC, ARG1) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
+
+ #else
+
+-typedef void (*NPN_MemFreeUPP)(void* ptr);
+-#define NewNPN_MemFreeProc(FUNC) \
+- ((NPN_MemFreeUPP) (FUNC))
+-#define CallNPN_MemFreeProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
++#define NewNPN_MemFreeProc(FUNC) \
++ ((NPN_MemFreeUPP) (FUNC))
++#define CallNPN_MemFreeProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
+
+ #endif
+
+
+ /* NPN_MemFlush */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_MemFlushUPP;
+ enum {
+- uppNPN_MemFlushProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
++ uppNPN_MemFlushProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(uint32)))
+ };
+
+-#define NewNPN_MemFlushProc(FUNC) \
+- (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
+-#define CallNPN_MemFlushProc(FUNC, ARG1) \
+- (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))
++#define NewNPN_MemFlushProc(FUNC) \
++ (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
++#define CallNPN_MemFlushProc(FUNC, ARG1) \
++ (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))
+
+ #else
+
+-typedef uint32 (*NPN_MemFlushUPP)(uint32 size);
+-#define NewNPN_MemFlushProc(FUNC) \
+- ((NPN_MemFlushUPP) (FUNC))
+-#define CallNPN_MemFlushProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
++#define NewNPN_MemFlushProc(FUNC) \
++ ((NPN_MemFlushUPP) (FUNC))
++#define CallNPN_MemFlushProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
+
+ #endif
+
+@@ -862,172 +905,749 @@
+
+ /* NPN_ReloadPlugins */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_ReloadPluginsUPP;
+ enum {
+- uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
+- | RESULT_SIZE(SIZE_CODE(0))
++ uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
++ | RESULT_SIZE(SIZE_CODE(0))
+ };
+
+-#define NewNPN_ReloadPluginsProc(FUNC) \
+- (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
+-#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))
++#define NewNPN_ReloadPluginsProc(FUNC) \
++ (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
++#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))
+
+ #else
+
+-typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages);
+-#define NewNPN_ReloadPluginsProc(FUNC) \
+- ((NPN_ReloadPluginsUPP) (FUNC))
+-#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
++#define NewNPN_ReloadPluginsProc(FUNC) \
++ ((NPN_ReloadPluginsUPP) (FUNC))
++#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
+
+ #endif
+
+-
+ /* NPN_GetJavaEnv */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_GetJavaEnvUPP;
+ enum {
+- uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
+- | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
++ uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
++ | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
+ };
+
+-#define NewNPN_GetJavaEnvProc(FUNC) \
+- (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
+-#define CallNPN_GetJavaEnvProc(FUNC) \
+- (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo)
++#define NewNPN_GetJavaEnvProc(FUNC) \
++ (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetJavaEnvProc(FUNC) \
++ (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo)
+
+ #else
+-
+-typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void);
+-#define NewNPN_GetJavaEnvProc(FUNC) \
+- ((NPN_GetJavaEnvUPP) (FUNC))
+-#define CallNPN_GetJavaEnvProc(FUNC) \
+- (*(FUNC))()
++typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
++#define NewNPN_GetJavaEnvProc(FUNC) \
++ ((NPN_GetJavaEnvUPP) (FUNC))
++#define CallNPN_GetJavaEnvProc(FUNC) \
++ (*(FUNC))()
+
+ #endif
+
+
+ /* NPN_GetJavaPeer */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_GetJavaPeerUPP;
+ enum {
+- uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
++ uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
+ };
+
+-#define NewNPN_GetJavaPeerProc(FUNC) \
+- (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
+-#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
+- (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1))
++#define NewNPN_GetJavaPeerProc(FUNC) \
++ (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1))
+
+ #else
+
+-typedef jref (*NPN_GetJavaPeerUPP)(NPP instance);
+-#define NewNPN_GetJavaPeerProc(FUNC) \
+- ((NPN_GetJavaPeerUPP) (FUNC))
+-#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
++#define NewNPN_GetJavaPeerProc(FUNC) \
++ ((NPN_GetJavaPeerUPP) (FUNC))
++#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
+
+ #endif
+
+-
+ /* NPN_InvalidateRect */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_InvalidateRectUPP;
+ enum {
+- uppNPN_InvalidateRectProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
+- | RESULT_SIZE(SIZE_CODE(0))
++ uppNPN_InvalidateRectProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
++ | RESULT_SIZE(SIZE_CODE(0))
+ };
+
+-#define NewNPN_InvalidateRectProc(FUNC) \
+- (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
+-#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))
++#define NewNPN_InvalidateRectProc(FUNC) \
++ (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
++#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))
+
+ #else
+
+-typedef void (*NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
+-#define NewNPN_InvalidateRectProc(FUNC) \
+- ((NPN_InvalidateRectUPP) (FUNC))
+-#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
+- (*(FUNC))((ARG1), (ARG2))
++typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
++#define NewNPN_InvalidateRectProc(FUNC) \
++ ((NPN_InvalidateRectUPP) (FUNC))
++#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
+
+ #endif
+
+
+ /* NPN_InvalidateRegion */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_InvalidateRegionUPP;
+ enum {
+- uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
+- | RESULT_SIZE(SIZE_CODE(0))
++ uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
++ | RESULT_SIZE(SIZE_CODE(0))
+ };
+
+-#define NewNPN_InvalidateRegionProc(FUNC) \
+- (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
+-#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
+- (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))
++#define NewNPN_InvalidateRegionProc(FUNC) \
++ (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
++#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
++ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))
+
+ #else
+
+-typedef void (*NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
+-#define NewNPN_InvalidateRegionProc(FUNC) \
+- ((NPN_InvalidateRegionUPP) (FUNC))
+-#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
+- (*(FUNC))((ARG1), (ARG2))
++typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
++#define NewNPN_InvalidateRegionProc(FUNC) \
++ ((NPN_InvalidateRegionUPP) (FUNC))
++#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
+
+ #endif
+
+ /* NPN_ForceRedraw */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPN_ForceRedrawUPP;
+ enum {
+- uppNPN_ForceRedrawProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(0)))
++ uppNPN_ForceRedrawProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(0)))
++};
++
++#define NewNPN_ForceRedrawProc(FUNC) \
++ (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
++#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1))
++
++#else
++
++typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance);
++#define NewNPN_ForceRedrawProc(FUNC) \
++ ((NPN_ForceRedrawUPP) (FUNC))
++#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_GetStringIdentifier */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_GetStringIdentifierUPP;
++enum {
++ uppNPN_GetStringIdentifierProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
++};
++
++#define NewNPN_GetStringIdentifierProc(FUNC) \
++ (NPN_GetStringIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifierProcInfo, (ARG1))
++
++#else
++
++typedef NPIdentifier (* NP_LOADDS NPN_GetStringIdentifierUPP)(const NPUTF8* name);
++#define NewNPN_GetStringIdentifierProc(FUNC) \
++ ((NPN_GetStringIdentifierUPP) (FUNC))
++#define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_GetStringIdentifiers */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_GetStringIdentifiersUPP;
++enum {
++ uppNPN_GetStringIdentifiersProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const NPUTF8**)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int32_t)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier*)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_GetStringIdentifiersProc(FUNC) \
++ (NPN_GetStringIdentifiersUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetStringIdentifiersProcInfo, (ARG1), (ARG2), (ARG3))
++
++#else
++
++typedef void (* NP_LOADDS NPN_GetStringIdentifiersUPP)(const NPUTF8** names,
++ int32_t nameCount,
++ NPIdentifier* identifiers);
++#define NewNPN_GetStringIdentifiersProc(FUNC) \
++ ((NPN_GetStringIdentifiersUPP) (FUNC))
++#define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
++
++#endif
++
++/* NPN_GetIntIdentifier */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_GetIntIdentifierUPP;
++enum {
++ uppNPN_GetIntIdentifierProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(int32_t)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPIdentifier)))
++};
++
++#define NewNPN_GetIntIdentifierProc(FUNC) \
++ (NPN_GetIntIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetIntIdentifierProcInfo, (ARG1))
++
++#else
++
++typedef NPIdentifier (* NP_LOADDS NPN_GetIntIdentifierUPP)(int32_t intid);
++#define NewNPN_GetIntIdentifierProc(FUNC) \
++ ((NPN_GetIntIdentifierUPP) (FUNC))
++#define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_IdentifierIsString */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_IdentifierIsStringUPP;
++enum {
++ uppNPN_IdentifierIsStringProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier identifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_IdentifierIsStringProc(FUNC) \
++ (NPN_IdentifierIsStringUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, GetCurrentArchitecture())
++#define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IdentifierIsStringProcInfo, (ARG1))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_IdentifierIsStringUPP)(NPIdentifier identifier);
++#define NewNPN_IdentifierIsStringProc(FUNC) \
++ ((NPN_IdentifierIsStringUPP) (FUNC))
++#define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_UTF8FromIdentifier */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_UTF8FromIdentifierUPP;
++enum {
++ uppNPN_UTF8FromIdentifierProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPUTF8*)))
++};
++
++#define NewNPN_UTF8FromIdentifierProc(FUNC) \
++ (NPN_UTF8FromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, GetCurrentArchitecture())
++#define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UTF8FromIdentifierProcInfo, (ARG1))
++
++#else
++
++typedef NPUTF8* (* NP_LOADDS NPN_UTF8FromIdentifierUPP)(NPIdentifier identifier);
++#define NewNPN_UTF8FromIdentifierProc(FUNC) \
++ ((NPN_UTF8FromIdentifierUPP) (FUNC))
++#define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_IntFromIdentifier */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_IntFromIdentifierUPP;
++enum {
++ uppNPN_IntFromIdentifierProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPIdentifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
++};
++
++#define NewNPN_IntFromIdentifierProc(FUNC) \
++ (NPN_IntFromIdentifierUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, GetCurrentArchitecture())
++#define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_IntFromIdentifierProcInfo, (ARG1))
++
++#else
++
++typedef int32_t (* NP_LOADDS NPN_IntFromIdentifierUPP)(NPIdentifier identifier);
++#define NewNPN_IntFromIdentifierProc(FUNC) \
++ ((NPN_IntFromIdentifierUPP) (FUNC))
++#define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_CreateObject */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_CreateObjectUPP;
++enum {
++ uppNPN_CreateObjectProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPClass*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
++};
++
++#define NewNPN_CreateObjectProc(FUNC) \
++ (NPN_CreateObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, GetCurrentArchitecture())
++#define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_CreateObjectProcInfo, (ARG1), (ARG2))
++
++#else
++
++typedef NPObject* (* NP_LOADDS NPN_CreateObjectUPP)(NPP npp, NPClass *aClass);
++#define NewNPN_CreateObjectProc(FUNC) \
++ ((NPN_CreateObjectUPP) (FUNC))
++#define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
++
++#endif
++
++/* NPN_RetainObject */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_RetainObjectUPP;
++enum {
++ uppNPN_RetainObjectProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPObject*)))
++};
++
++#define NewNPN_RetainObjectProc(FUNC) \
++ (NPN_RetainObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, GetCurrentArchitecture())
++#define CallNPN_RetainObjectProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RetainObjectProcInfo, (ARG1))
++
++#else
++
++typedef NPObject* (* NP_LOADDS NPN_RetainObjectUPP)(NPObject *obj);
++#define NewNPN_RetainObjectProc(FUNC) \
++ ((NPN_RetainObjectUPP) (FUNC))
++#define CallNPN_RetainObjectProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_ReleaseObject */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_ReleaseObjectUPP;
++enum {
++ uppNPN_ReleaseObjectProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_ReleaseObjectProc(FUNC) \
++ (NPN_ReleaseObjectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, GetCurrentArchitecture())
++#define CallNPN_ReleaseObjectProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseObjectProcInfo, (ARG1))
++
++#else
++
++typedef void (* NP_LOADDS NPN_ReleaseObjectUPP)(NPObject *obj);
++#define NewNPN_ReleaseObjectProc(FUNC) \
++ ((NPN_ReleaseObjectUPP) (FUNC))
++#define CallNPN_ReleaseObjectProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_Invoke */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_InvokeUPP;
++enum {
++ uppNPN_InvokeProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t)))
++ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_InvokeProc(FUNC) \
++ (NPN_InvokeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeProcInfo, GetCurrentArchitecture())
++#define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_InvokeUPP)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
++#define NewNPN_InvokeProc(FUNC) \
++ ((NPN_InvokeUPP) (FUNC))
++#define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
++
++#endif
++
++/* NPN_InvokeDefault */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_InvokeDefaultUPP;
++enum {
++ uppNPN_InvokeDefaultProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
++ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint32_t)))
++ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
+ };
+
+-#define NewNPN_ForceRedrawProc(FUNC) \
+- (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
+-#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
+- (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1))
++#define NewNPN_InvokeDefaultProc(FUNC) \
++ (NPN_InvokeDefaultUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, GetCurrentArchitecture())
++#define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvokeDefaultProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+
+ #else
+
+-typedef void (*NPN_ForceRedrawUPP)(NPP instance);
+-#define NewNPN_ForceRedrawProc(FUNC) \
+- ((NPN_ForceRedrawUPP) (FUNC))
+-#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
+- (*(FUNC))((ARG1))
++typedef bool (* NP_LOADDS NPN_InvokeDefaultUPP)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
++#define NewNPN_InvokeDefaultProc(FUNC) \
++ ((NPN_InvokeDefaultUPP) (FUNC))
++#define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+
+ #endif
+
++/* NPN_Evaluate */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_EvaluateUPP;
++enum {
++ uppNPN_EvaluateProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPString*)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_EvaluateProc(FUNC) \
++ (NPN_EvaluateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_EvaluateProcInfo, GetCurrentArchitecture())
++#define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_EvaluateProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_EvaluateUPP)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
++#define NewNPN_EvaluateProc(FUNC) \
++ ((NPN_EvaluateUPP) (FUNC))
++#define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
++
++#endif
++
++/* NPN_GetProperty */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_GetPropertyUPP;
++enum {
++ uppNPN_GetPropertyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_GetPropertyProc(FUNC) \
++ (NPN_GetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, GetCurrentArchitecture())
++#define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_GetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
++#define NewNPN_GetPropertyProc(FUNC) \
++ ((NPN_GetPropertyUPP) (FUNC))
++#define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
++
++#endif
++
++/* NPN_SetProperty */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_SetPropertyUPP;
++enum {
++ uppNPN_SetPropertyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(const NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_SetPropertyProc(FUNC) \
++ (NPN_SetPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, GetCurrentArchitecture())
++#define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetPropertyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_SetPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
++#define NewNPN_SetPropertyProc(FUNC) \
++ ((NPN_SetPropertyUPP) (FUNC))
++#define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
++
++#endif
++
++/* NPN_RemoveProperty */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_RemovePropertyUPP;
++enum {
++ uppNPN_RemovePropertyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_RemovePropertyProc(FUNC) \
++ (NPN_RemovePropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, GetCurrentArchitecture())
++#define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RemovePropertyProcInfo, (ARG1), (ARG2), (ARG3))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_RemovePropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
++#define NewNPN_RemovePropertyProc(FUNC) \
++ ((NPN_RemovePropertyUPP) (FUNC))
++#define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
++
++#endif
++
++/* NPN_HasProperty */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_HasPropertyUPP;
++enum {
++ uppNPN_HasPropertyProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_HasPropertyProc(FUNC) \
++ (NPN_HasPropertyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, GetCurrentArchitecture())
++#define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasPropertyProcInfo, (ARG1), (ARG2), (ARG3))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_HasPropertyUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
++#define NewNPN_HasPropertyProc(FUNC) \
++ ((NPN_HasPropertyUPP) (FUNC))
++#define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
++
++#endif
++
++/* NPN_HasMethod */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_HasMethodUPP;
++enum {
++ uppNPN_HasMethodProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPIdentifier)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(bool)))
++};
++
++#define NewNPN_HasMethodProc(FUNC) \
++ (NPN_HasMethodUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_HasMethodProcInfo, GetCurrentArchitecture())
++#define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_HasMethodProcInfo, (ARG1), (ARG2), (ARG3))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_HasMethodUPP)(NPP npp, NPObject *obj, NPIdentifier propertyName);
++#define NewNPN_HasMethodProc(FUNC) \
++ ((NPN_HasMethodUPP) (FUNC))
++#define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \
++ (*(FUNC))((ARG1), (ARG2), (ARG3))
++
++#endif
++
++/* NPN_ReleaseVariantValue */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_ReleaseVariantValue;
++enum {
++ uppNPN_ReleaseVariantValueProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPVariant*)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_ReleaseVariantValueProc(FUNC) \
++ (NPN_ReleaseVariantValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, GetCurrentArchitecture())
++#define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReleaseVariantValueProcInfo, (ARG1))
++
++#else
++
++typedef void (* NP_LOADDS NPN_ReleaseVariantValueUPP)(NPVariant *variant);
++#define NewNPN_ReleaseVariantValueProc(FUNC) \
++ ((NPN_ReleaseVariantValueUPP) (FUNC))
++#define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++/* NPN_SetException */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_SetExceptionUPP;
++enum {
++ uppNPN_SetExceptionProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPObject*)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const NPUTF8*)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_SetExceptionProc(FUNC) \
++ (NPN_SetExceptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, GetCurrentArchitecture())
++#define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetExceptionProcInfo, (ARG1), (ARG2))
++
++#else
++
++typedef void (* NP_LOADDS NPN_SetExceptionUPP)(NPObject *obj, const NPUTF8 *message);
++#define NewNPN_SetExceptionProc(FUNC) \
++ ((NPN_SetExceptionUPP) (FUNC))
++#define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
++
++#endif
++
++/* NPN_PushPopupsEnabledStateUPP */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_PushPopupsEnabledStateUPP;
++enum {
++ uppNPN_PushPopupsEnabledStateProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPBool)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_PushPopupsEnabledStateProc(FUNC) \
++ (NPN_PushPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, GetCurrentArchitecture())
++#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PushPopupsEnabledStateProcInfo, (ARG1), (ARG2))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_PushPopupsEnabledStateUPP)(NPP npp, NPBool enabled);
++#define NewNPN_PushPopupsEnabledStateProc(FUNC) \
++ ((NPN_PushPopupsEnabledStateUPP) (FUNC))
++#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \
++ (*(FUNC))((ARG1), (ARG2))
++
++#endif
++
++/* NPN_PopPopupsEnabledState */
++
++#if _NPUPP_USE_UPP_
++
++typedef UniversalProcPtr NPN_PopPopupsEnabledStateUPP;
++enum {
++ uppNPN_PopPopupsEnabledStateProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
++ | RESULT_SIZE(SIZE_CODE(0))
++};
++
++#define NewNPN_PopPopupsEnabledStateProc(FUNC) \
++ (NPN_PopPopupsEnabledStateUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, GetCurrentArchitecture())
++#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \
++ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PopPopupsEnabledStateProcInfo, (ARG1))
++
++#else
++
++typedef bool (* NP_LOADDS NPN_PopPopupsEnabledStateUPP)(NPP npp);
++#define NewNPN_PopPopupsEnabledStateProc(FUNC) \
++ ((NPN_PopPopupsEnabledStateUPP) (FUNC))
++#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \
++ (*(FUNC))((ARG1))
++
++#endif
++
++
+
+ /******************************************************************************************
+ * The actual plugin function table definitions
+ *******************************************************************************************/
+
+ #ifdef XP_MAC
+-#pragma align=mac68k
++#if PRAGMA_STRUCT_ALIGN
++#pragma options align=mac68k
++#endif
+ #endif
+
+ typedef struct _NPPluginFuncs {
+@@ -1073,14 +1693,37 @@
+ NPN_InvalidateRectUPP invalidaterect;
+ NPN_InvalidateRegionUPP invalidateregion;
+ NPN_ForceRedrawUPP forceredraw;
++ NPN_GetStringIdentifierUPP getstringidentifier;
++ NPN_GetStringIdentifiersUPP getstringidentifiers;
++ NPN_GetIntIdentifierUPP getintidentifier;
++ NPN_IdentifierIsStringUPP identifierisstring;
++ NPN_UTF8FromIdentifierUPP utf8fromidentifier;
++ NPN_IntFromIdentifierUPP intfromidentifier;
++ NPN_CreateObjectUPP createobject;
++ NPN_RetainObjectUPP retainobject;
++ NPN_ReleaseObjectUPP releaseobject;
++ NPN_InvokeUPP invoke;
++ NPN_InvokeDefaultUPP invokeDefault;
++ NPN_EvaluateUPP evaluate;
++ NPN_GetPropertyUPP getproperty;
++ NPN_SetPropertyUPP setproperty;
++ NPN_RemovePropertyUPP removeproperty;
++ NPN_HasPropertyUPP hasproperty;
++ NPN_HasMethodUPP hasmethod;
++ NPN_ReleaseVariantValueUPP releasevariantvalue;
++ NPN_SetExceptionUPP setexception;
++ NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
++ NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
+ } NPNetscapeFuncs;
+
+ #ifdef XP_MAC
+-#pragma align=reset
++#if PRAGMA_STRUCT_ALIGN
++#pragma options align=reset
++#endif
+ #endif
+
+
+-#ifdef XP_MAC
++#if defined(XP_MAC) || defined(XP_MACOSX)
+ /******************************************************************************************
+ * Mac platform-specific plugin glue stuff
+ *******************************************************************************************/
+@@ -1092,52 +1735,137 @@
+ * and NPPShutdownUPP for Netscape's use.
+ */
+
+-#if GENERATINGCFM
++#if _NPUPP_USE_UPP_
+
+ typedef UniversalProcPtr NPP_MainEntryUPP;
+ enum {
+- uppNPP_MainEntryProcInfo = kThinkCStackBased
+- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
+- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
+- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
+- | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+-};
+-#define NewNPP_MainEntryProc(FUNC) \
+- (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
+-#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
+- CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
++ uppNPP_MainEntryProcInfo = kThinkCStackBased
++ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
++ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
++ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
++ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
++};
++#define NewNPP_MainEntryProc(FUNC) \
++ (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
++#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
++ CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
+
+ #else
+
+-typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
+-#define NewNPP_MainEntryProc(FUNC) \
+- ((NPP_MainEntryUPP) (FUNC))
+-#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
+- (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
++typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
++#define NewNPP_MainEntryProc(FUNC) \
++ ((NPP_MainEntryUPP) (FUNC))
++#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
++ (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
++
++#endif
++
++
++/*
++ * Mac version(s) of NP_GetMIMEDescription(const char *)
++ * These can be called to retreive MIME information from the plugin dynamically
++ *
++ * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
++ * to get mime info from the plugin only on OSX and may not be supported
++ * in furture version--use NP_GetMIMEDescription instead
++ */
++
++enum
++{
++ kBPSupportedMIMETypesStructVers_1 = 1
++};
++
++typedef struct _BPSupportedMIMETypes
++{
++ SInt32 structVersion; /* struct version */
++ Handle typeStrings; /* STR# formated handle, allocated by plug-in */
++ Handle infoStrings; /* STR# formated handle, allocated by plug-in */
++} BPSupportedMIMETypes;
++OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
++
++#if _NPUPP_USE_UPP_
++
++#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD"
++typedef UniversalProcPtr NP_GetMIMEDescriptionUPP;
++enum {
++ uppNP_GetMIMEDescEntryProc = kThinkCStackBased
++ | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
++};
++#define NewNP_GetMIMEDescEntryProc(FUNC) \
++ (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture())
++#define CallNP_GetMIMEDescEntryProc(FUNC) \
++ (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc)
++
++
++#else /* !_NPUPP_USE_UPP_ */
++
++ /* NP_GetMIMEDescription */
++#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
++typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
++#define NewNP_GetMIMEDescEntryProc(FUNC) \
++ ((NP_GetMIMEDescriptionUPP) (FUNC))
++#define CallNP_GetMIMEDescEntryProc(FUNC) \
++ (*(FUNC))()
++/* BP_GetSupportedMIMETypes */
++typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32);
++#define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \
++ ((BP_GetSupportedMIMETypesUPP) (FUNC))
++#define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \
++ (*(FUNC))((mimeInfo), (flags))
+
+ #endif
+ #endif /* MAC */
+
++#if defined(_WINDOWS)
++#define OSCALL WINAPI
++#else
++#if defined(__OS2__)
++#define OSCALL _System
++#else
++#define OSCALL
++#endif
++#endif
+
+-#ifdef _WINDOWS
++#if defined( _WINDOWS ) || defined (__OS2__)
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ /* plugin meta member functions */
++#if defined(__OS2__)
++
++typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */
++ char *pMimeTypes;
++ char *pFileExtents;
++ char *pFileOpenTemplate;
++ char *pProductName;
++ char *pProductDescription;
++ unsigned long dwProductVersionMS;
++ unsigned long dwProductVersionLS;
++} NPPluginData;
++
++NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
++
++#endif
++
++NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+
+-NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs);
++NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs);
+
+-NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs);
++NPError OSCALL NP_Shutdown();
+
+-NPError WINAPI NP_Shutdown();
++char* NP_GetMIMEDescription();
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+-#endif /* _WINDOWS */
++#endif /* _WINDOWS || __OS2__ */
++
++#if defined(__OS2__)
++#pragma pack()
++#endif
+
+ #ifdef XP_UNIX
+
+@@ -1147,9 +1875,10 @@
+
+ /* plugin meta member functions */
+
+-char* NP_GetMIMEDescription(void);
+-NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
+-NPError NP_Shutdown(void);
++char* NP_GetMIMEDescription(void);
++NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*);
++NPError NP_Shutdown(void);
++NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
+
+ #ifdef __cplusplus
+ }
+--- a/nsplugins/sdk/npapi.h
++++ b/nsplugins/sdk/npapi.h
+@@ -1,78 +1,214 @@
+-/* -*- Mode: C; tab-width: 4; -*- */
++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Netscape Public License
++ * Version 1.1 (the "License"); you may not use this file except in
++ * compliance with the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/NPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by 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 NPL, 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 NPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++
+ /*
+- * npapi.h $Revision: 67527 $
++ * npapi.h
+ * Netscape client plug-in API spec
+ */
+
+ #ifndef _NPAPI_H_
+ #define _NPAPI_H_
+
++#ifdef __OS2__
++#pragma pack(1)
++#endif
++
++#include "prtypes.h"
++/* Copied from xp_core.h */
++/* removed #ifdef for hpux defined in /usr/include/model.h */
++#ifndef XP_MAC
++#ifndef _INT16
++#define _INT16
++#endif
++#ifndef _INT32
++#define _INT32
++#endif
++#ifndef _UINT16
++#define _UINT16
++#endif
++#ifndef _UINT32
++#define _UINT32
++#endif
++#endif
++
++/*
++ * NO_NSPR_10_SUPPORT disables the inclusion
++ * of obsolete/protypes.h, whose int16, uint16,
++ * int32, and uint32 typedefs conflict with those
++ * in this file.
++ */
++#ifndef NO_NSPR_10_SUPPORT
++#define NO_NSPR_10_SUPPORT
++#endif
++#ifdef OJI
+ #include "jri.h" /* Java Runtime Interface */
++#endif
++
++#if defined (__OS2__ ) || defined (OS2)
++# ifndef XP_OS2
++# define XP_OS2 1
++# endif /* XP_OS2 */
++#endif /* __OS2__ */
+
+ #ifdef _WINDOWS
+-# ifndef XP_WIN
+-# define XP_WIN 1
+-# endif /* XP_WIN */
++# include <windef.h>
++# ifndef XP_WIN
++# define XP_WIN 1
++# endif /* XP_WIN */
+ #endif /* _WINDOWS */
+
+ #ifdef __MWERKS__
+-# define _declspec __declspec
+-# ifdef macintosh
+-# ifndef XP_MAC
+-# define XP_MAC 1
+-# endif /* XP_MAC */
+-# endif /* macintosh */
+-# ifdef __INTEL__
+-# undef NULL
+-# ifndef XP_WIN
+-# define XP_WIN 1
+-# endif /* __INTEL__ */
+-# endif /* XP_PC */
++# define _declspec __declspec
++# ifdef macintosh
++# ifndef XP_MAC
++# define XP_MAC 1
++# endif /* XP_MAC */
++# endif /* macintosh */
++# ifdef __INTEL__
++# undef NULL
++# ifndef XP_WIN
++# define XP_WIN 1
++# endif /* XP_WIN */
++# endif /* __INTEL__ */
+ #endif /* __MWERKS__ */
+
+-#ifdef XP_MAC
+- #include <Quickdraw.h>
+- #include <Events.h>
++#if defined(XP_MAC) || defined(XP_MACOSX)
++ #include <Quickdraw.h>
++ #include <Events.h>
+ #endif
+-
+-#ifdef XP_UNIX
+- #include <X11/Xlib.h>
+- #include <X11/Xutil.h>
+-#endif
+
++#if defined(XP_UNIX)
++# include <stdio.h>
++# if defined(MOZ_X11)
++# include <X11/Xlib.h>
++# include <X11/Xutil.h>
++# endif
++#endif
+
+ /*----------------------------------------------------------------------*/
+-/* Plugin Version Constants */
++/* Plugin Version Constants */
+ /*----------------------------------------------------------------------*/
+
+ #define NP_VERSION_MAJOR 0
+-#define NP_VERSION_MINOR 11
++#define NP_VERSION_MINOR 13
++
++
++/* The OS/2 version of Netscape uses RC_DATA to define the
++ mime types, file extensions, etc that are required.
++ Use a vertical bar to separate types, end types with \0.
++ FileVersion and ProductVersion are 32bit ints, all other
++ entries are strings the MUST be terminated wwith a \0.
++
++AN EXAMPLE:
++
++RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
++
++RCDATA NP_INFO_MIMEType { "video/x-video|",
++ "video/x-flick\0" }
++RCDATA NP_INFO_FileExtents { "avi|",
++ "flc\0" }
++RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
++ "MMOS2 Flc/Fli player(*.flc)\0" }
++
++RCDATA NP_INFO_FileVersion { 1,0,0,1 }
++RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
++RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
++RCDATA NP_INFO_InternalName { "NPAVI32\0" )
++RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
++RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
++RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
++
++*/
++
++
++/* RC_DATA types for version info - required */
++#define NP_INFO_ProductVersion 1
++#define NP_INFO_MIMEType 2
++#define NP_INFO_FileOpenName 3
++#define NP_INFO_FileExtents 4
++
++/* RC_DATA types for version info - used if found */
++#define NP_INFO_FileDescription 5
++#define NP_INFO_ProductName 6
++
++/* RC_DATA types for version info - optional */
++#define NP_INFO_CompanyName 7
++#define NP_INFO_FileVersion 8
++#define NP_INFO_InternalName 9
++#define NP_INFO_LegalCopyright 10
++#define NP_INFO_OriginalFilename 11
++
++#ifndef RC_INVOKED
+
+
+
+ /*----------------------------------------------------------------------*/
+-/* Definition of Basic Types */
++/* Definition of Basic Types */
+ /*----------------------------------------------------------------------*/
+
+ #ifndef _UINT16
+ typedef unsigned short uint16;
+ #endif
++
+ #ifndef _UINT32
+-#if defined(__alpha)
++# if defined(__alpha) || defined(_AIX) || defined(__x86_64__) || defined(__LP64__) || defined(__amd64__)
+ typedef unsigned int uint32;
+-#else /* __alpha */
++# else
+ typedef unsigned long uint32;
+-#endif /* __alpha */
++# endif
+ #endif
++
++/*
++ * AIX defines these in sys/inttypes.h included from sys/types.h
++ */
++#ifndef AIX
+ #ifndef _INT16
+ typedef short int16;
+ #endif
++
+ #ifndef _INT32
+-#if defined(__alpha) || defined(_AIX)
++# if defined(__alpha) || defined(_AIX) || defined(__x86_64__) || defined(__LP64__) || defined(__amd64__)
+ typedef int int32;
+-#else /* __alpha || _AIX */
++# else
+ typedef long int32;
+-#endif /* __alpha || _AIX */
++# endif
++#endif
+ #endif
+
+ #ifndef FALSE
+@@ -85,15 +221,15 @@
+ #define NULL (0L)
+ #endif
+
+-typedef unsigned char NPBool;
+-typedef int16 NPError;
+-typedef int16 NPReason;
+-typedef char* NPMIMEType;
++typedef unsigned char NPBool;
++typedef int16 NPError;
++typedef int16 NPReason;
++typedef char* NPMIMEType;
+
+
+
+ /*----------------------------------------------------------------------*/
+-/* Structures and definitions */
++/* Structures and definitions */
+ /*----------------------------------------------------------------------*/
+
+ #ifdef XP_MAC
+@@ -105,8 +241,8 @@
+ */
+ typedef struct _NPP
+ {
+- void* pdata; /* plug-in private data */
+- void* ndata; /* netscape private data */
++ void* pdata; /* plug-in private data */
++ void* ndata; /* netscape private data */
+ } NPP_t;
+
+ typedef NPP_t* NPP;
+@@ -114,38 +250,43 @@
+
+ typedef struct _NPStream
+ {
+- void* pdata; /* plug-in private data */
+- void* ndata; /* netscape private data */
+- const char* url;
+- uint32 end;
+- uint32 lastmodified;
+- void* notifyData;
++ void* pdata; /* plug-in private data */
++ void* ndata; /* netscape private data */
++ const char* url;
++ uint32 end;
++ uint32 lastmodified;
++ void* notifyData;
+ } NPStream;
+
+
+ typedef struct _NPByteRange
+ {
+- int32 offset; /* negative offset means from the end */
+- uint32 length;
+- struct _NPByteRange* next;
++ int32 offset; /* negative offset means from the end */
++ uint32 length;
++ struct _NPByteRange* next;
+ } NPByteRange;
+
+
+ typedef struct _NPSavedData
+ {
+- int32 len;
+- void* buf;
++ int32 len;
++ void* buf;
+ } NPSavedData;
+
+
+ typedef struct _NPRect
+ {
+- uint16 top;
+- uint16 left;
+- uint16 bottom;
+- uint16 right;
++ uint16 top;
++ uint16 left;
++ uint16 bottom;
++ uint16 right;
+ } NPRect;
+
++typedef struct _NPSize
++{
++ int32 width;
++ int32 height;
++} NPSize;
+
+ #ifdef XP_UNIX
+ /*
+@@ -164,26 +305,71 @@
+
+ typedef struct
+ {
+- int32 type;
++ int32 type;
+ } NPAnyCallbackStruct;
+
+ typedef struct
+ {
+- int32 type;
+- Display* display;
+- Visual* visual;
+- Colormap colormap;
+- unsigned int depth;
++ int32 type;
++#ifdef MOZ_X11
++ Display* display;
++ Visual* visual;
++ Colormap colormap;
++ unsigned int depth;
++#endif
+ } NPSetWindowCallbackStruct;
+
+ typedef struct
+ {
+- int32 type;
+- FILE* fp;
++ int32 type;
++ FILE* fp;
+ } NPPrintCallbackStruct;
+
+ #endif /* XP_UNIX */
+
++
++/*
++ * The following masks are applied on certain platforms to NPNV and
++ * NPPV selectors that pass around pointers to COM interfaces. Newer
++ * compilers on some platforms may generate vtables that are not
++ * compatible with older compilers. To prevent older plugins from
++ * not understanding a new browser's ABI, these masks change the
++ * values of those selectors on those platforms. To remain backwards
++ * compatible with differenet versions of the browser, plugins can
++ * use these masks to dynamically determine and use the correct C++
++ * ABI that the browser is expecting. This does not apply to Windows
++ * as Microsoft's COM ABI will likely not change.
++ */
++
++#define NP_ABI_GCC3_MASK 0x10000000
++/*
++ * gcc 3.x generated vtables on UNIX and OSX are incompatible with
++ * previous compilers.
++ */
++#if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
++#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
++#else
++#define _NP_ABI_MIXIN_FOR_GCC3 0
++#endif
++
++
++#define NP_ABI_MACHO_MASK 0x01000000
++/*
++ * On OSX, the Mach-O executable format is significantly
++ * different than CFM. In addition to having a different
++ * C++ ABI, it also has has different C calling convention.
++ * You must use glue code when calling between CFM and
++ * Mach-O C functions.
++ */
++#if (defined(TARGET_RT_MAC_MACHO))
++#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
++#else
++#define _NP_ABI_MIXIN_FOR_MACHO 0
++#endif
++
++
++#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
++
+ /*
+ * List of variable names for which NPP_GetValue shall be implemented
+ */
+@@ -191,7 +377,18 @@
+ NPPVpluginNameString = 1,
+ NPPVpluginDescriptionString,
+ NPPVpluginWindowBool,
+- NPPVpluginTransparentBool
++ NPPVpluginTransparentBool,
++ NPPVjavaClass, /* Not implemented in Mozilla 1.0 */
++ NPPVpluginWindowSize,
++ NPPVpluginTimerInterval,
++
++ NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
++ NPPVpluginScriptableIID = 11,
++
++ /* 12 and over are available on Mozilla builds starting with 0.9.9 */
++ NPPVjavascriptPushCallerBool = 12,
++ NPPVpluginKeepLibraryInMemory = 13, /* available in Mozilla 1.0 */
++ NPPVpluginNeedsXEmbed = 14
+ } NPPVariable;
+
+ /*
+@@ -200,124 +397,157 @@
+ typedef enum {
+ NPNVxDisplay = 1,
+ NPNVxtAppContext,
+- NPNVnetscapeWindow,
++ NPNVnetscapeWindow,
+ NPNVjavascriptEnabledBool,
+ NPNVasdEnabledBool,
+- NPNVisOfflineBool
++ NPNVisOfflineBool,
++
++ /* 10 and over are available on Mozilla builds starting with 0.9.4 */
++ NPNVserviceManager = (10 | NP_ABI_MASK),
++ NPNVDOMElement = (11 | NP_ABI_MASK), /* available in Mozilla 1.2 */
++ NPNVDOMWindow = (12 | NP_ABI_MASK),
++ NPNVToolkit = (13 | NP_ABI_MASK),
++ NPNVSupportsXEmbedBool = 14
+ } NPNVariable;
+
+ /*
++ * The type of Tookkit the widgets use
++ */
++typedef enum {
++ NPNVGtk12 = 1,
++ NPNVGtk2
++} NPNToolkitType;
++
++/*
+ * The type of a NPWindow - it specifies the type of the data structure
+ * returned in the window field.
+ */
+ typedef enum {
+- NPWindowTypeWindow = 1,
+- NPWindowTypeDrawable
++ NPWindowTypeWindow = 1,
++ NPWindowTypeDrawable
+ } NPWindowType;
+
+ typedef struct _NPWindow
+ {
+- void* window; /* Platform specific window handle */
+- int32 x; /* Position of top left corner relative */
+- int32 y; /* to a netscape page. */
+- uint32 width; /* Maximum window size */
+- uint32 height;
+- NPRect clipRect; /* Clipping rectangle in port coordinates */
+- /* Used by MAC only. */
+-#ifdef XP_UNIX
+- void * ws_info; /* Platform-dependent additonal data */
++ void* window; /* Platform specific window handle */
++ /* OS/2: x - Position of bottom left corner */
++ /* OS/2: y - relative to visible netscape window */
++ int32 x; /* Position of top left corner relative */
++ int32 y; /* to a netscape page. */
++ uint32 width; /* Maximum window size */
++ uint32 height;
++ NPRect clipRect; /* Clipping rectangle in port coordinates */
++ /* Used by MAC only. */
++#if defined(XP_UNIX) && !defined(XP_MACOSX)
++ void * ws_info; /* Platform-dependent additional data */
+ #endif /* XP_UNIX */
+- NPWindowType type; /* Is this a window or a drawable? */
++ NPWindowType type; /* Is this a window or a drawable? */
+ } NPWindow;
+
+
+ typedef struct _NPFullPrint
+ {
+- NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
+- /* printing */
+- NPBool printOne; /* TRUE if plugin should print one copy */
+- /* to default printer */
+- void* platformPrint; /* Platform-specific printing info */
++ NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
++ NPBool printOne; /* TRUE if plugin should print one copy to default printer */
++ void* platformPrint; /* Platform-specific printing info */
+ } NPFullPrint;
+
+ typedef struct _NPEmbedPrint
+ {
+- NPWindow window;
+- void* platformPrint; /* Platform-specific printing info */
++ NPWindow window;
++ void* platformPrint; /* Platform-specific printing info */
+ } NPEmbedPrint;
+
+ typedef struct _NPPrint
+ {
+- uint16 mode; /* NP_FULL or NP_EMBED */
+- union
+- {
+- NPFullPrint fullPrint; /* if mode is NP_FULL */
+- NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
+- } print;
++ uint16 mode; /* NP_FULL or NP_EMBED */
++ union
++ {
++ NPFullPrint fullPrint; /* if mode is NP_FULL */
++ NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
++ } print;
+ } NPPrint;
+
+-#ifdef XP_MAC
+-typedef EventRecord NPEvent;
++#if defined(XP_MAC) || defined(XP_MACOSX)
++typedef EventRecord NPEvent;
+ #elif defined(XP_WIN)
+ typedef struct _NPEvent
+ {
+- uint16 event;
+- uint32 wParam;
+- uint32 lParam;
++ uint16 event;
++ uint32 wParam;
++ uint32 lParam;
++} NPEvent;
++#elif defined(XP_OS2)
++typedef struct _NPEvent
++{
++ uint32 event;
++ uint32 wParam;
++ uint32 lParam;
+ } NPEvent;
+-#elif defined (XP_UNIX)
++#elif defined (XP_UNIX) && defined(MOZ_X11)
+ typedef XEvent NPEvent;
+ #else
+-typedef void* NPEvent;
++typedef void* NPEvent;
+ #endif /* XP_MAC */
+
+-#ifdef XP_MAC
++#if defined(XP_MAC) || defined(XP_MACOSX)
+ typedef RgnHandle NPRegion;
+ #elif defined(XP_WIN)
+ typedef HRGN NPRegion;
+-#elif defined(XP_UNIX)
++#elif defined(XP_UNIX) && defined(MOZ_X11)
+ typedef Region NPRegion;
+ #else
+ typedef void *NPRegion;
+ #endif /* XP_MAC */
+
+-#ifdef XP_MAC
++#if defined(XP_MAC) || defined(XP_MACOSX)
+ /*
+ * Mac-specific structures and definitions.
+ */
+
+ typedef struct NP_Port
+ {
+- CGrafPtr port; /* Grafport */
+- int32 portx; /* position inside the topmost window */
+- int32 porty;
++ CGrafPtr port; /* Grafport */
++ int32 portx; /* position inside the topmost window */
++ int32 porty;
+ } NP_Port;
+
+ /*
+ * Non-standard event types that can be passed to HandleEvent
+ */
+-#define getFocusEvent (osEvt + 16)
+-#define loseFocusEvent (osEvt + 17)
+-#define adjustCursorEvent (osEvt + 18)
+
+-#endif /* XP_MAC */
++enum NPEventType {
++ NPEventType_GetFocusEvent = (osEvt + 16),
++ NPEventType_LoseFocusEvent,
++ NPEventType_AdjustCursorEvent,
++ NPEventType_MenuCommandEvent,
++ NPEventType_ClippingChangedEvent,
++ NPEventType_ScrollingBeginsEvent = 1000,
++ NPEventType_ScrollingEndsEvent
++};
+
++#ifdef OBSOLETE
++#define getFocusEvent (osEvt + 16)
++#define loseFocusEvent (osEvt + 17)
++#define adjustCursorEvent (osEvt + 18)
++#endif
++#endif /* XP_MAC */
+
+ /*
+ * Values for mode passed to NPP_New:
+ */
+-#define NP_EMBED 1
+-#define NP_FULL 2
++#define NP_EMBED 1
++#define NP_FULL 2
+
+ /*
+ * Values for stream type passed to NPP_NewStream:
+ */
+-#define NP_NORMAL 1
+-#define NP_SEEK 2
+-#define NP_ASFILE 3
+-#define NP_ASFILEONLY 4
++#define NP_NORMAL 1
++#define NP_SEEK 2
++#define NP_ASFILE 3
++#define NP_ASFILEONLY 4
+
+-#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
++#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
+
+ #ifdef XP_MAC
+ #pragma options align=reset
+@@ -325,38 +555,38 @@
+
+
+ /*----------------------------------------------------------------------*/
+-/* Error and Reason Code definitions */
++/* Error and Reason Code definitions */
+ /*----------------------------------------------------------------------*/
+
+ /*
+- * Values of type NPError:
++ * Values of type NPError:
+ */
+-#define NPERR_BASE 0
+-#define NPERR_NO_ERROR (NPERR_BASE + 0)
+-#define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
+-#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
+-#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
++#define NPERR_BASE 0
++#define NPERR_NO_ERROR (NPERR_BASE + 0)
++#define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
++#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
++#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
+ #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
+-#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
+-#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
++#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
++#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
+ #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
+ #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
+-#define NPERR_INVALID_PARAM (NPERR_BASE + 9)
+-#define NPERR_INVALID_URL (NPERR_BASE + 10)
+-#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
+-#define NPERR_NO_DATA (NPERR_BASE + 12)
+-#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
++#define NPERR_INVALID_PARAM (NPERR_BASE + 9)
++#define NPERR_INVALID_URL (NPERR_BASE + 10)
++#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
++#define NPERR_NO_DATA (NPERR_BASE + 12)
++#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
+
+ /*
+- * Values of type NPReason:
++ * Values of type NPReason:
+ */
+-#define NPRES_BASE 0
+-#define NPRES_DONE (NPRES_BASE + 0)
+-#define NPRES_NETWORK_ERR (NPRES_BASE + 1)
+-#define NPRES_USER_BREAK (NPRES_BASE + 2)
++#define NPRES_BASE 0
++#define NPRES_DONE (NPRES_BASE + 0)
++#define NPRES_NETWORK_ERR (NPRES_BASE + 1)
++#define NPRES_USER_BREAK (NPRES_BASE + 2)
+
+ /*
+- * Don't use these obsolete error codes any more.
++ * Don't use these obsolete error codes any more.
+ */
+ #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
+ #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
+@@ -365,23 +595,27 @@
+ /*
+ * Version feature information
+ */
+-#define NPVERS_HAS_STREAMOUTPUT 8
+-#define NPVERS_HAS_NOTIFICATION 9
+-#define NPVERS_HAS_LIVECONNECT 9
+-#define NPVERS_WIN16_HAS_LIVECONNECT 9
+-#define NPVERS_68K_HAS_LIVECONNECT 11
+-#define NPVERS_HAS_WINDOWLESS 11
+-
++#define NPVERS_HAS_STREAMOUTPUT 8
++#define NPVERS_HAS_NOTIFICATION 9
++#define NPVERS_HAS_LIVECONNECT 9
++#define NPVERS_WIN16_HAS_LIVECONNECT 9
++#define NPVERS_68K_HAS_LIVECONNECT 11
++#define NPVERS_HAS_WINDOWLESS 11
++#define NPVERS_HAS_XPCONNECT_SCRIPTING 13
+
+ /*----------------------------------------------------------------------*/
+-/* Function Prototypes */
++/* Function Prototypes */
+ /*----------------------------------------------------------------------*/
+
+ #if defined(_WINDOWS) && !defined(WIN32)
+ #define NP_LOADDS _loadds
+ #else
++#if defined(__OS2__)
++#define NP_LOADDS _System
++#else
+ #define NP_LOADDS
+ #endif
++#endif
+
+ #ifdef __cplusplus
+ extern "C" {
+@@ -392,78 +626,80 @@
+ */
+
+ #ifdef XP_UNIX
+-char* NPP_GetMIMEDescription(void);
++char* NPP_GetMIMEDescription(void);
+ #endif /* XP_UNIX */
+
+-NPError NPP_Initialize(void);
+-void NPP_Shutdown(void);
+-NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
+- uint16 mode, int16 argc, char* argn[],
+- char* argv[], NPSavedData* saved);
+-NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
+-NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
+-NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
+- NPStream* stream, NPBool seekable,
+- uint16* stype);
+-NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
+- NPReason reason);
+-int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
+-int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
+- int32 len, void* buffer);
+-void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
+- const char* fname);
+-void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
+-int16 NPP_HandleEvent(NPP instance, void* event);
+-void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
+- NPReason reason, void* notifyData);
+-jref NP_LOADDS NPP_GetJavaClass(void);
+-NPError NPP_GetValue(void *instance, NPPVariable variable,
+- void *value);
+-NPError NPP_SetValue(void *instance, NPNVariable variable,
+- void *value);
++NPError NP_LOADDS NPP_Initialize(void);
++void NP_LOADDS NPP_Shutdown(void);
++NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
++ uint16 mode, int16 argc, char* argn[],
++ char* argv[], NPSavedData* saved);
++NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
++NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
++NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
++ NPStream* stream, NPBool seekable,
++ uint16* stype);
++NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
++ NPReason reason);
++int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
++int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
++ int32 len, void* buffer);
++void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
++ const char* fname);
++void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
++int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
++void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
++ NPReason reason, void* notifyData);
++#ifdef OJI
++jref NP_LOADDS NPP_GetJavaClass(void);
++#endif
++NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
++NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
+
+ /*
+ * NPN_* functions are provided by the navigator and called by the plugin.
+ */
+-
+-void NPN_Version(int* plugin_major, int* plugin_minor,
+- int* netscape_major, int* netscape_minor);
+-NPError NPN_GetURLNotify(NPP instance, const char* url,
+- const char* target, void* notifyData);
+-NPError NPN_GetURL(NPP instance, const char* url,
+- const char* target);
+-NPError NPN_PostURLNotify(NPP instance, const char* url,
+- const char* target, uint32 len,
+- const char* buf, NPBool file,
+- void* notifyData);
+-NPError NPN_PostURL(NPP instance, const char* url,
+- const char* target, uint32 len,
+- const char* buf, NPBool file);
+-NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
+-NPError NPN_NewStream(NPP instance, NPMIMEType type,
+- const char* target, NPStream** stream);
+-int32 NPN_Write(NPP instance, NPStream* stream, int32 len,
+- void* buffer);
+-NPError NPN_DestroyStream(NPP instance, NPStream* stream,
+- NPReason reason);
+-void NPN_Status(NPP instance, const char* message);
+-const char* NPN_UserAgent(NPP instance);
+-void* NPN_MemAlloc(uint32 size);
+-void NPN_MemFree(void* ptr);
+-uint32 NPN_MemFlush(uint32 size);
+-void NPN_ReloadPlugins(NPBool reloadPages);
+-JRIEnv* NPN_GetJavaEnv(void);
+-jref NPN_GetJavaPeer(NPP instance);
+-NPError NPN_GetValue(NPP instance, NPNVariable variable,
+- void *value);
+-NPError NPN_SetValue(NPP instance, NPPVariable variable,
+- void *value);
+-void NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
+-void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
+-void NPN_ForceRedraw(NPP instance);
++void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
++ int* netscape_major, int* netscape_minor);
++NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
++ const char* target, void* notifyData);
++NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
++ const char* target);
++NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
++ const char* target, uint32 len,
++ const char* buf, NPBool file,
++ void* notifyData);
++NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
++ const char* target, uint32 len,
++ const char* buf, NPBool file);
++NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
++NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
++ const char* target, NPStream** stream);
++int32 NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
++NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
++void NP_LOADDS NPN_Status(NPP instance, const char* message);
++const char* NP_LOADDS NPN_UserAgent(NPP instance);
++void* NP_LOADDS NPN_MemAlloc(uint32 size);
++void NP_LOADDS NPN_MemFree(void* ptr);
++uint32 NP_LOADDS NPN_MemFlush(uint32 size);
++void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
++#ifdef OJI
++JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
++jref NP_LOADDS NPN_GetJavaPeer(NPP instance);
++#endif
++NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
++NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
++void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
++void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
++void NP_LOADDS NPN_ForceRedraw(NPP instance);
+
+ #ifdef __cplusplus
+ } /* end extern "C" */
+ #endif
+
++#endif /* RC_INVOKED */
++#ifdef __OS2__
++#pragma pack()
++#endif
++
+ #endif /* _NPAPI_H_ */
+--- a/nsplugins/viewer/nsplugin.cpp
++++ b/nsplugins/viewer/nsplugin.cpp
+@@ -180,6 +180,12 @@
+ // Offline browsing - no thanks
+ *(bool*)value = false;
+ return NPERR_NO_ERROR;
++ case NPNVToolkit:
++ *(NPNToolkitType*)value = NPNVGtk2;
++ return NPERR_NO_ERROR;
++ case NPNVSupportsXEmbedBool:
++ *(bool*)value = true;
++ return NPERR_NO_ERROR;
+ default:
+ return NPERR_INVALID_PARAM;
+ }
+@@ -484,6 +490,8 @@
+ KProtocolManager kpm;
+ QString agent = kpm.userAgentForHost("nspluginviewer");
+ kdDebug(1431) << "g_NPN_UserAgent() = " << agent << endl;
++ // flash crashes without Firefox UA
++ agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/2007101500 Firefox/2.0.0.10";
+ return agent.latin1();
+ }
+
+@@ -583,7 +591,7 @@
+ KLibrary *handle, int width, int height,
+ QString src, QString /*mime*/,
+ QString appId, QString callbackId,
+- bool embed,
++ bool embed, WId xembed,
+ QObject *parent, const char* name )
+ : DCOPObject(), QObject( parent, name )
+ {
+@@ -599,6 +607,8 @@
+ _streams.setAutoDelete( true );
+ _waitingRequests.setAutoDelete( true );
+ _callback = new NSPluginCallbackIface_stub( appId.latin1(), callbackId.latin1() );
++ _xembed_window = xembed;
++ _toplevel = _form = 0;
+
+ KURL base(src);
+ base.setFileName( QString::null );
+@@ -619,51 +629,53 @@
+ if (height == 0)
+ height = 1200;
+
+- // create drawing area
+- Arg args[7];
+- Cardinal nargs = 0;
+- XtSetArg(args[nargs], XtNwidth, width); nargs++;
+- XtSetArg(args[nargs], XtNheight, height); nargs++;
+- XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
+-
+- String n, c;
+- XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
+-
+- _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
+- qt_xdisplay(), args, nargs);
+-
+- // What exactly does widget mapping mean? Without this call the widget isn't
+- // embedded correctly. With it the viewer doesn't show anything in standalone mode.
+- //if (embed)
+- XtSetMappedWhenManaged(_toplevel, False);
+- XtRealizeWidget(_toplevel);
+-
+- // Create form window that is searched for by flash plugin
+- _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
+- XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
+- XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
+- XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
+- XtSetValues(_form, args, nargs);
+- XSync(qt_xdisplay(), false);
++ if( _xembed_window == 0 ) {
++ // create drawing area
++ Arg args[7];
++ Cardinal nargs = 0;
++ XtSetArg(args[nargs], XtNwidth, width); nargs++;
++ XtSetArg(args[nargs], XtNheight, height); nargs++;
++ XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
++
++ String n, c;
++ XtGetApplicationNameAndClass(qt_xdisplay(), &n, &c);
++
++ _toplevel = XtAppCreateShell("drawingArea", c, applicationShellWidgetClass,
++ qt_xdisplay(), args, nargs);
++
++ // What exactly does widget mapping mean? Without this call the widget isn't
++ // embedded correctly. With it the viewer doesn't show anything in standalone mode.
++ //if (embed)
++ XtSetMappedWhenManaged(_toplevel, False);
++ XtRealizeWidget(_toplevel);
++
++ // Create form window that is searched for by flash plugin
++ _form = XtVaCreateWidget("form", compositeWidgetClass, _toplevel, NULL);
++ XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
++ XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
++ XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
++ XtSetValues(_form, args, nargs);
++ XSync(qt_xdisplay(), false);
+
+- // From mozilla - not sure if it's needed yet, nor what to use for embedder
++ // From mozilla - not sure if it's needed yet, nor what to use for embedder
+ #if 0
+- /* this little trick seems to finish initializing the widget */
++ /* this little trick seems to finish initializing the widget */
+ #if XlibSpecificationRelease >= 6
+- XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
++ XtRegisterDrawable(qt_xdisplay(), embedderid, _toplevel);
+ #else
+- _XtRegisterWindow(embedderid, _toplevel);
++ _XtRegisterWindow(embedderid, _toplevel);
+ #endif
+ #endif
+- XtRealizeWidget(_form);
+- XtManageChild(_form);
++ XtRealizeWidget(_form);
++ XtManageChild(_form);
+
+- // Register forwarder
+- XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask),
+- False, forwarder, (XtPointer)this );
+- XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask),
+- False, forwarder, (XtPointer)this );
+- XSync(qt_xdisplay(), false);
++ // Register forwarder
++ XtAddEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask),
++ False, forwarder, (XtPointer)this );
++ XtAddEventHandler(_form, (KeyPressMask|KeyReleaseMask),
++ False, forwarder, (XtPointer)this );
++ XSync(qt_xdisplay(), false);
++ }
+ }
+
+ NSPluginInstance::~NSPluginInstance()
+@@ -714,14 +726,16 @@
+ if (saved)
+ g_NPN_MemFree(saved);
+
+- XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask),
+- False, forwarder, (XtPointer)this);
+- XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask),
+- False, forwarder, (XtPointer)this);
+- XtDestroyWidget(_form);
+- _form = 0;
+- XtDestroyWidget(_toplevel);
+- _toplevel = 0;
++ if( _form != 0 ) {
++ XtRemoveEventHandler(_form, (KeyPressMask|KeyReleaseMask),
++ False, forwarder, (XtPointer)this);
++ XtRemoveEventHandler(_toplevel, (KeyPressMask|KeyReleaseMask),
++ False, forwarder, (XtPointer)this);
++ XtDestroyWidget(_form);
++ _form = 0;
++ XtDestroyWidget(_toplevel);
++ _toplevel = 0;
++ }
+
+ if (_npp) {
+ ::free(_npp); // matched with malloc() in newInstance
+@@ -806,7 +820,7 @@
+ s->post( url, req.data, req.mime, req.notify, req.args );
+ } else if (url.lower().startsWith("javascript:")){
+ if (_callback) {
+- static int _jsrequestid = 0;
++ static Q_INT32 _jsrequestid = 0;
+ _jsrequests.insert(_jsrequestid, new Request(req));
+ _callback->evalJavaScript(_jsrequestid++, url.mid(11));
+ } else {
+@@ -902,8 +916,7 @@
+ _timer->start( 100, true );
+ }
+
+-
+-int NSPluginInstance::setWindow(int remove)
++int NSPluginInstance::setWindow(Q_INT8 remove)
+ {
+ if (remove)
+ {
+@@ -926,14 +939,24 @@
+ _win.clipRect.bottom = _height;
+ _win.clipRect.right = _width;
+
+- _win.window = (void*) XtWindow(_form);
+- kdDebug(1431) << "Window ID = " << _win.window << endl;
++ if( _xembed_window ) {
++ _win.window = (void*) _xembed_window;
++ _win_info.type = NP_SETWINDOW;
++ _win_info.display = qt_xdisplay();
++ _win_info.visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++ _win_info.colormap = DefaultColormapOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++ _win_info.depth = DefaultDepthOfScreen(DefaultScreenOfDisplay(qt_xdisplay()));
++ } else {
++ _win.window = (void*) XtWindow(_form);
+
+- _win_info.type = NP_SETWINDOW;
+- _win_info.display = XtDisplay(_form);
+- _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
+- _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
+- _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
++ _win_info.type = NP_SETWINDOW;
++ _win_info.display = XtDisplay(_form);
++ _win_info.visual = DefaultVisualOfScreen(XtScreen(_form));
++ _win_info.colormap = DefaultColormapOfScreen(XtScreen(_form));
++ _win_info.depth = DefaultDepthOfScreen(XtScreen(_form));
++ }
++
++ kdDebug(1431) << "Window ID = " << _win.window << endl;
+
+ _win.ws_info = &_win_info;
+
+@@ -957,11 +980,8 @@
+ }
+
+
+-void NSPluginInstance::resizePlugin(int w, int h)
++void NSPluginInstance::resizePlugin(Q_INT32 w, Q_INT32 h)
+ {
+- if (!_visible)
+- return;
+-
+ if (w == _width && h == _height)
+ return;
+
+@@ -970,22 +990,30 @@
+ _width = w;
+ _height = h;
+
+- XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
+- XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
+-
+- Arg args[7];
+- Cardinal nargs = 0;
+- XtSetArg(args[nargs], XtNwidth, _width); nargs++;
+- XtSetArg(args[nargs], XtNheight, _height); nargs++;
+- XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
+- XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
+- XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
+- XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
+-
+- XtSetValues(_toplevel, args, nargs);
+- XtSetValues(_form, args, nargs);
+-
+- resizeWidgets(XtWindow(_form), _width, _height);
++ if( _form != 0 ) {
++ XResizeWindow(qt_xdisplay(), XtWindow(_form), w, h);
++ XResizeWindow(qt_xdisplay(), XtWindow(_toplevel), w, h);
++
++ Arg args[7];
++ Cardinal nargs = 0;
++ XtSetArg(args[nargs], XtNwidth, _width); nargs++;
++ XtSetArg(args[nargs], XtNheight, _height); nargs++;
++ XtSetArg(args[nargs], XtNvisual, QPaintDevice::x11AppVisual()); nargs++;
++ XtSetArg(args[nargs], XtNdepth, QPaintDevice::x11AppDepth()); nargs++;
++ XtSetArg(args[nargs], XtNcolormap, QPaintDevice::x11AppColormap()); nargs++;
++ XtSetArg(args[nargs], XtNborderWidth, 0); nargs++;
++
++ XtSetValues(_toplevel, args, nargs);
++ XtSetValues(_form, args, nargs);
++
++ resizeWidgets(XtWindow(_form), _width, _height);
++ }
++
++ // If not visible yet, displayWindow() will call setWindow() again anyway, so avoid this.
++ // This also handled plugins that are broken and cannot handle repeated setWindow() calls
++ // very well.
++ if (!_visible)
++ return;
+
+ setWindow();
+
+@@ -993,7 +1021,7 @@
+ }
+
+
+-void NSPluginInstance::javascriptResult(int id, QString result) {
++void NSPluginInstance::javascriptResult(Q_INT32 id, QString result) {
+ QMap<int, Request*>::iterator i = _jsrequests.find( id );
+ if (i != _jsrequests.end()) {
+ Request *req = i.data();
+@@ -1190,6 +1218,34 @@
+ kdDebug(1431) << "<- NSPluginInstance::displayPlugin = " << (void*)this << endl;
+ }
+
++static bool has_focus = false;
++
++void NSPluginInstance::gotFocusIn()
++{
++ has_focus = true;
++}
++
++void NSPluginInstance::gotFocusOut()
++{
++ has_focus = false;
++}
++
++#include <dlfcn.h>
++// Prevent plugins from polling the keyboard regardless of focus.
++static int (*real_xquerykeymap)( Display*, char[32] ) = NULL;
++
++extern "C" KDE_EXPORT
++int XQueryKeymap( Display* dpy, char k[32] )
++{
++ if( real_xquerykeymap == NULL )
++ real_xquerykeymap = (int (*)( Display*, char[32] )) dlsym( RTLD_NEXT, "XQueryKeymap" );
++ if( has_focus )
++ return real_xquerykeymap( dpy, k );
++ memset( k, 0, 32 );
++ return 1;
++}
++
++
+
+ /***************************************************************************/
+
+@@ -1402,10 +1458,10 @@
+ }
+
+
+-DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, bool embed,
++DCOPRef NSPluginClass::newInstance( QString url, QString mimeType, Q_INT8 embed,
+ QStringList argn, QStringList argv,
+ QString appId, QString callbackId,
+- bool reload, bool doPost, QByteArray postData )
++ Q_INT8 reload, Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed )
+ {
+ kdDebug(1431) << "-> NSPluginClass::NewInstance" << endl;
+
+@@ -1449,16 +1505,25 @@
+ memset(npp, 0, sizeof(NPP_t));
+ npp->ndata = NULL;
+
+- // Create plugin instance object
+- NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
+- width, height, baseURL, mimeType,
+- appId, callbackId, embed, this );
+-
+ // create plugin instance
+ NPError error = _pluginFuncs.newp(mime, npp, embed ? NP_EMBED : NP_FULL,
+ argc, _argn, _argv, 0);
+ kdDebug(1431) << "NPP_New = " << (int)error << endl;
+
++ // don't use bool here, it can be 1 byte, but some plugins write it as int, and I can't find what the spec says
++ int wants_xembed = false;
++ if (_pluginFuncs.getvalue) {
++ NPError error = _pluginFuncs.getvalue(npp, (NPPVariable)14/*NPPVpluginNeedsXEmbed*/, &wants_xembed );
++ if( error != NPERR_NO_ERROR )
++ wants_xembed = false;
++ }
++ kdDebug(1431) << "Plugin requires XEmbed:" << (bool)wants_xembed << endl;
++
++ // Create plugin instance object
++ NSPluginInstance *inst = new NSPluginInstance( npp, &_pluginFuncs, _handle,
++ width, height, baseURL, mimeType,
++ appId, callbackId, embed, wants_xembed ? xembed : 0, this );
++
+ // free arrays with arguments
+ delete [] _argn;
+ delete [] _argv;
+@@ -1493,7 +1558,6 @@
+ timer(); //_timer->start( 0, TRUE );
+ }
+
+-
+ /****************************************************************************/
+
+ NSPluginStreamBase::NSPluginStreamBase( NSPluginInstance *instance )
+@@ -1516,8 +1580,6 @@
+
+ delete _tempFile;
+ _tempFile = 0;
+- delete _queue;
+- _queue = 0;
+ }
+
+
+--- a/nsplugins/viewer/viewer.cpp
++++ b/nsplugins/viewer/viewer.cpp
+@@ -52,6 +52,7 @@
+ #include <X11/Shell.h>
+ #else
+ #include "qxteventloop.h"
++#include "glibevents.h"
+ #endif
+
+ /**
+@@ -249,6 +250,7 @@
+
+ kdDebug(1430) << "4 - create KApplication" << endl;
+ KApplication app( argc, argv, "nspluginviewer" );
++ GlibEvents glibevents;
+ #endif
+
+ {
+--- a/nsplugins/viewer/NSPluginClassIface.h
++++ b/nsplugins/viewer/NSPluginClassIface.h
+@@ -47,10 +47,10 @@
+
+ k_dcop:
+
+- virtual DCOPRef newInstance(QString url, QString mimeType, bool embed,
++ virtual DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed,
+ QStringList argn, QStringList argv,
+- QString appId, QString callbackId, bool reload,
+- bool doPost, QByteArray postData) = 0;
++ QString appId, QString callbackId, Q_INT8 reload,
++ Q_INT8 doPost, QByteArray postData, Q_UINT32 xembed) = 0;
+ virtual QString getMIMEDescription() = 0;
+
+ };
+@@ -66,13 +66,16 @@
+
+ virtual int winId() = 0;
+
+- virtual int setWindow(int remove=0) = 0;
++ virtual int setWindow(Q_INT8 remove=0) = 0;
+
+- virtual void resizePlugin(int w, int h) = 0;
++ virtual void resizePlugin(Q_INT32 w, Q_INT32 h) = 0;
+
+- virtual void javascriptResult(int id, QString result) = 0;
++ virtual void javascriptResult(Q_INT32 id, QString result) = 0;
+
+ virtual void displayPlugin() = 0;
++
++ virtual void gotFocusIn() = 0;
++ virtual void gotFocusOut() = 0;
+ };
+
+
+--- /dev/null
++++ b/nsplugins/viewer/glibevents.cpp
+@@ -0,0 +1,43 @@
++/*
++ Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++*/
++
++#include "glibevents.h"
++
++#include <qapplication.h>
++
++GlibEvents::GlibEvents()
++ {
++ g_main_context_ref( g_main_context_default());
++ connect( &timer, SIGNAL( timeout()), SLOT( process()));
++ // TODO Poll for now
++ timer.start( 10 );
++ }
++
++GlibEvents::~GlibEvents()
++ {
++ g_main_context_unref( g_main_context_default());
++ }
++
++void GlibEvents::process()
++ {
++ while( g_main_context_pending( g_main_context_default()))
++ g_main_context_iteration( g_main_context_default(), false );
++ }
++
++#include "glibevents.moc"
+--- a/nsplugins/viewer/nsplugin.h
++++ b/nsplugins/viewer/nsplugin.h
+@@ -46,6 +46,7 @@
+
+
+ #define XP_UNIX
++#define MOZ_X11
+ #include "sdk/npupp.h"
+
+ typedef char* NP_GetMIMEDescriptionUPP(void);
+@@ -164,17 +165,19 @@
+ // constructor, destructor
+ NSPluginInstance( NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle,
+ int width, int height, QString src, QString mime,
+- QString appId, QString callbackId, bool embed,
++ QString appId, QString callbackId, bool embed, WId xembed,
+ QObject *parent, const char* name=0 );
+ ~NSPluginInstance();
+
+ // DCOP functions
+ void shutdown();
+- int winId() { return XtWindow(_form); }
+- int setWindow(int remove=0);
+- void resizePlugin(int w, int h);
+- void javascriptResult(int id, QString result);
++ int winId() { return _form != 0 ? XtWindow(_form) : 0; }
++ int setWindow(Q_INT8 remove=0);
++ void resizePlugin(Q_INT32 w, Q_INT32 h);
++ void javascriptResult(Q_INT32 id, QString result);
+ void displayPlugin();
++ void gotFocusIn();
++ void gotFocusOut();
+
+ // value handling
+ NPError NPGetValue(NPPVariable variable, void *value);
+@@ -231,6 +234,7 @@
+ NPPluginFuncs _pluginFuncs;
+
+ Widget _area, _form, _toplevel;
++ WId _xembed_window;
+ QString _baseURL;
+ int _width, _height;
+
+@@ -277,10 +281,10 @@
+ ~NSPluginClass();
+
+ QString getMIMEDescription();
+- DCOPRef newInstance(QString url, QString mimeType, bool embed,
++ DCOPRef newInstance(QString url, QString mimeType, Q_INT8 embed,
+ QStringList argn, QStringList argv,
+- QString appId, QString callbackId, bool reload, bool post,
+- QByteArray postData );
++ QString appId, QString callbackId, Q_INT8 reload, Q_INT8 post,
++ QByteArray postData, Q_UINT32 xembed );
+ void destroyInstance( NSPluginInstance* inst );
+ bool error() { return _error; }
+
+--- /dev/null
++++ b/nsplugins/viewer/glibevents.h
+@@ -0,0 +1,41 @@
++/*
++ Copyright (c) 2007 Lubos Lunak <l.lunak at suse.cz>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++*/
++
++#ifndef GLIBEVENTS_H
++#define GLIBEVENTS_H
++
++#include <qwidget.h>
++#include <qtimer.h>
++
++#include <glib.h>
++
++class GlibEvents
++ : public QWidget
++ {
++ Q_OBJECT
++ public:
++ GlibEvents();
++ virtual ~GlibEvents();
++ private slots:
++ void process();
++ private:
++ QTimer timer;
++ };
++
++#endif
+--- a/nsplugins/viewer/Makefile.am
++++ b/nsplugins/viewer/Makefile.am
+@@ -1,12 +1,11 @@
+-INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes)
++INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes) `pkg-config --cflags glib-2.0`
+ METASOURCES = AUTO
+
+ bin_PROGRAMS = nspluginviewer
+
+ nspluginviewer_SOURCES = NSPluginCallbackIface.stub NSPluginClassIface.skel \
+- nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp
+-nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic
++ nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp glibevents.cpp
++nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic `pkg-config --libs glib-2.0`
+ nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
+
+ NSPluginCallbackIface_DIR = $(srcdir)/..
+-
+--- a/nsplugins/nspluginloader.cpp
++++ b/nsplugins/nspluginloader.cpp
+@@ -41,6 +41,7 @@
+ #include <qpushbutton.h>
+ #include <qxembed.h>
+ #include <qtextstream.h>
++#include <qtimer.h>
+ #include <qregexp.h>
+
+ #include "nspluginloader.h"
+@@ -54,11 +55,14 @@
+ int NSPluginLoader::s_refCount = 0;
+
+
+-NSPluginInstance::NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id)
+- : DCOPStub(app, id), NSPluginInstanceIface_stub(app, id), EMBEDCLASS(parent)
++NSPluginInstance::NSPluginInstance(QWidget *parent)
++ : EMBEDCLASS(parent), _loader( NULL ), shown( false ), inited( false ), resize_count( 0 ), stub( NULL )
+ {
+- _loader = 0L;
+- shown = false;
++}
++
++void NSPluginInstance::init(const QCString& app, const QCString& obj)
++{
++ stub = new NSPluginInstanceIface_stub( app, obj );
+ QGridLayout *_layout = new QGridLayout(this, 1, 1);
+ KConfig cfg("kcmnspluginrc", false);
+ cfg.setGroup("Misc");
+@@ -69,23 +73,37 @@
+ show();
+ } else {
+ _button = 0L;
+- doLoadPlugin();
++ // Protection against repeated NPSetWindow() - Flash v9,0,115,0 doesn't handle
++ // repeated NPSetWindow() calls properly, which happens when NSPluginInstance is first
++ // shown and then resized. Which is what happens with KHTML. Therefore use 'shown'
++ // to detect whether the widget is shown and drop all resize events before that,
++ // and use 'resize_count' to wait for that one more resize to come (plus a timer
++ // for a possible timeout). Only then flash is actually initialized ('inited' is true).
++ resize_count = 1;
++ QTimer::singleShot( 1000, this, SLOT( doLoadPlugin()));
+ }
+ }
+
+
+ void NSPluginInstance::doLoadPlugin() {
+- if (!_loader) {
++ if (!inited) {
+ delete _button;
+ _button = 0L;
+ _loader = NSPluginLoader::instance();
+ setBackgroundMode(QWidget::NoBackground);
+- setProtocol(QXEmbed::XPLAIN);
+- embed( NSPluginInstanceIface_stub::winId() );
++ WId winid = stub->winId();
++ if( winid != 0 ) {
++ setProtocol(QXEmbed::XPLAIN);
++ embed( winid );
++ } else {
++ setProtocol(QXEmbed::XEMBED);
++ }
++ // resize before showing, some plugins are stupid and can't handle repeated
++ // NPSetWindow() calls very well (viewer will avoid the call if not shown yet)
++ resizePlugin(width(), height());
+ displayPlugin();
+ show();
+- shown = true;
+- if (isVisible()) resizePlugin(width(), height());
++ inited = true;
+ }
+ }
+
+@@ -93,10 +111,13 @@
+ NSPluginInstance::~NSPluginInstance()
+ {
+ kdDebug() << "-> NSPluginInstance::~NSPluginInstance" << endl;
+- shutdown();
++ if( inited )
++ shutdown();
+ kdDebug() << "release" << endl;
+- _loader->release();
++ if(_loader)
++ _loader->release();
+ kdDebug() << "<- NSPluginInstance::~NSPluginInstance" << endl;
++ delete stub;
+ }
+
+
+@@ -112,8 +133,14 @@
+
+ void NSPluginInstance::resizeEvent(QResizeEvent *event)
+ {
+- if (shown == false)
++ if (shown == false) // ignore all resizes before being shown
+ return;
++ if( !inited && resize_count > 0 ) {
++ if( --resize_count == 0 )
++ doLoadPlugin();
++ else
++ return;
++ }
+ EMBEDCLASS::resizeEvent(event);
+ if (isVisible()) {
+ resizePlugin(width(), height());
+@@ -124,7 +151,39 @@
+ void NSPluginInstance::showEvent(QShowEvent *event)
+ {
+ EMBEDCLASS::showEvent(event);
+- resizePlugin(width(), height());
++ shown = true;
++ if(!inited && resize_count == 0 )
++ doLoadPlugin();
++ if(inited)
++ resizePlugin(width(), height());
++}
++
++void NSPluginInstance::focusInEvent( QFocusEvent* event )
++{
++ stub->gotFocusIn();
++}
++
++void NSPluginInstance::focusOutEvent( QFocusEvent* event )
++{
++ stub->gotFocusOut();
++}
++
++void NSPluginInstance::displayPlugin()
++{
++ qApp->syncX(); // process pending X commands
++ stub->displayPlugin();
++}
++
++void NSPluginInstance::resizePlugin( int w, int h )
++{
++ qApp->syncX();
++ stub->resizePlugin( w, h );
++}
++
++void NSPluginInstance::shutdown()
++{
++ if( stub )
++ stub->shutdown();
+ }
+
+ /*******************************************************************************/
+@@ -445,19 +504,19 @@
+ if ( mime=="application/x-shockwave-flash" )
+ embed = true; // flash doesn't work in full mode :(
+
++ NSPluginInstance *plugin = new NSPluginInstance( parent );
++ kdDebug() << "<- NSPluginLoader::NewInstance = " << (void*)plugin << endl;
+
+ // get plugin instance
+- DCOPRef inst_ref = cls->newInstance( url, mime, embed, argn, argv, appId, callbackId, reload, doPost, postData);
++ DCOPRef inst_ref = cls->newInstance( url, mime, embed, argn, argv, appId, callbackId, reload, doPost, postData, plugin->winId());
+ if ( inst_ref.isNull() )
+ {
+ kdDebug() << "Couldn't create plugin instance" << endl;
++ delete plugin;
+ return 0;
+ }
+
+- NSPluginInstance *plugin = new NSPluginInstance( parent, inst_ref.app(),
+- inst_ref.object() );
+-
+- kdDebug() << "<- NSPluginLoader::NewInstance = " << (void*)plugin << endl;
++ plugin->init( inst_ref.app(), inst_ref.object() );
+
+ return plugin;
+ }
+--- a/nsplugins/nspluginloader.h
++++ b/nsplugins/nspluginloader.h
+@@ -43,13 +43,16 @@
+ class QPushButton;
+ class QGridLayout;
+
+-class NSPluginInstance : public EMBEDCLASS, virtual public NSPluginInstanceIface_stub
++class NSPluginInstance : public EMBEDCLASS
+ {
+ Q_OBJECT
+
+ public:
+- NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id);
++ NSPluginInstance(QWidget *parent);
++ void init( const QCString& app, const QCString& obj );
+ ~NSPluginInstance();
++public: // wrappers
++ void javascriptResult( int id, QString result ) { stub->javascriptResult( id, result ); }
+
+ private slots:
+ void doLoadPlugin();
+@@ -58,10 +61,19 @@
+ void resizeEvent(QResizeEvent *event);
+ void showEvent (QShowEvent *);
+ void windowChanged(WId w);
++ virtual void focusInEvent( QFocusEvent* event );
++ virtual void focusOutEvent( QFocusEvent* event );
+ class NSPluginLoader *_loader;
+ bool shown;
++ bool inited;
++ int resize_count;
+ QPushButton *_button;
+ QGridLayout *_layout;
++ NSPluginInstanceIface_stub* stub;
++private: // wrappers
++ void displayPlugin();
++ void resizePlugin( int w, int h );
++ void shutdown();
+ };
+
+
Added: branches/etch/packages/kdebase/debian/patches/01_nsplugins_regression_fix_branch_r757345.diff
===================================================================
--- branches/etch/packages/kdebase/debian/patches/01_nsplugins_regression_fix_branch_r757345.diff (rev 0)
+++ branches/etch/packages/kdebase/debian/patches/01_nsplugins_regression_fix_branch_r757345.diff 2008-01-26 16:49:50 UTC (rev 9165)
@@ -0,0 +1,128 @@
+--- a/kcontrol/kcontrol/modules.cpp
++++ b/kcontrol/kcontrol/modules.cpp
+@@ -48,7 +48,7 @@
+
+ ConfigModule::ConfigModule(const KService::Ptr &s)
+ : KCModuleInfo(s), _changed(false), _module(0), _embedWidget(0),
+- _rootProcess(0), _embedLayout(0), _embedFrame(0)
++ _rootProcess(0), _embedLayout(0), _embedFrame(0), _embedStack(0)
+ {
+ }
+
+@@ -97,6 +97,8 @@
+
+ delete _embedWidget;
+ _embedWidget = 0;
++ delete _embedStack;
++ _embedStack = 0;
+ delete _embedFrame;
+ _embedFrame = 0;
+ kapp->syncX();
+@@ -136,6 +138,7 @@
+ delete _rootProcess;
+ delete _embedWidget;
+ delete _embedLayout;
++ delete _embedStack;
+
+ // create an embed widget that will embed the
+ // kcmshell running as root
+@@ -149,14 +152,18 @@
+ _embedFrame->setLineWidth( 2 );
+ _embedFrame->setMidLineWidth( 2 );
+ _embedLayout->addWidget(_embedFrame,1);
+- _embedWidget = new QXEmbed(_embedFrame );
++ // cannot reparent anything else inside QXEmbed, so put the busy label separately
++ _embedStack = new QWidgetStack(_embedFrame);
++ _embedWidget = new KControlEmbed(_embedStack);
+ _module->hide();
+ _embedFrame->show();
+- QLabel *_busy = new QLabel(i18n("<big>Loading...</big>"), _embedWidget);
++ QLabel *_busy = new QLabel(i18n("<big>Loading...</big>"), _embedStack);
+ _busy->setAlignment(AlignCenter);
+ _busy->setTextFormat(RichText);
+ _busy->setGeometry(0,0, _module->width(), _module->height());
+ _busy->show();
++ _embedStack->raiseWidget(_busy);
++ connect(_embedWidget, SIGNAL( windowEmbedded(WId)), SLOT( embedded()));
+
+ // prepare the process to run the kcmshell
+ QString cmd = service()->exec().stripWhiteSpace();
+@@ -191,7 +198,7 @@
+ // We also don't have a way to close the module in that case.
+ *_rootProcess << "--n"; // Don't keep password.
+ if (kdeshell) {
+- *_rootProcess << QString("kcmshell %1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
++ *_rootProcess << QString("%1 %2 --embed %3 --lang %4").arg(locate("exe", "kcmshell")).arg(cmd).arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
+ }
+ else {
+ *_rootProcess << QString("%1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
+@@ -209,6 +216,8 @@
+ }
+
+ // clean up in case of failure
++ delete _embedStack;
++ _embedStack = 0;
+ delete _embedFrame;
+ _embedWidget = 0;
+ delete _embedLayout;
+@@ -239,6 +248,11 @@
+ emit childClosed();
+ }
+
++void ConfigModule::embedded()
++{
++ _embedStack->raiseWidget(_embedWidget); // put it above the busy label
++}
++
+ const KAboutData *ConfigModule::aboutData() const
+ {
+ if (!_module) return 0;
+--- a/kcontrol/kcontrol/modules.h
++++ b/kcontrol/kcontrol/modules.h
+@@ -23,6 +23,7 @@
+ #include <kcmoduleinfo.h>
+ #include <qobject.h>
+ #include <qdict.h>
++#include <qxembed.h>
+
+ template<class ConfigModule> class QPtrList;
+ class QStringList;
+@@ -33,6 +34,7 @@
+ class QXEmbed;
+ class QVBoxLayout;
+ class QVBox;
++class QWidgetStack;
+
+ class ConfigModule : public QObject, public KCModuleInfo
+ {
+@@ -62,6 +64,7 @@
+ void clientChanged(bool state);
+ void runAsRoot();
+ void rootExited(KProcess *proc);
++ void embedded();
+
+
+ signals:
+@@ -80,6 +83,7 @@
+ KProcess *_rootProcess;
+ QVBoxLayout *_embedLayout;
+ QVBox *_embedFrame;
++ QWidgetStack *_embedStack;
+
+ };
+
+@@ -119,4 +123,14 @@
+ QDict<Menu> subMenus;
+ };
+
++class KControlEmbed : public QXEmbed
++ {
++ Q_OBJECT
++ public:
++ KControlEmbed( QWidget* w ) : QXEmbed( w ) {}
++ virtual void windowChanged( WId w ) { if( w ) emit windowEmbedded( w ); }
++ signals:
++ void windowEmbedded( WId w );
++ };
++
+ #endif
Added: branches/etch/packages/kdebase/debian/patches/01_nsplugins_viewer_64bit_fix_r764342.diff
===================================================================
--- branches/etch/packages/kdebase/debian/patches/01_nsplugins_viewer_64bit_fix_r764342.diff (rev 0)
+++ branches/etch/packages/kdebase/debian/patches/01_nsplugins_viewer_64bit_fix_r764342.diff 2008-01-26 16:49:50 UTC (rev 9165)
@@ -0,0 +1,59 @@
+--- a/nsplugins/viewer/qxteventloop.cpp
++++ b/nsplugins/viewer/qxteventloop.cpp
+@@ -32,12 +32,16 @@
+ ** not clear to you.
+ **
+ **********************************************************************/
++
++#include <config.h>
++
+ #include "qxteventloop.h"
+
+ #if QT_VERSION >= 0x030100
+
+ #include <qapplication.h>
+ #include <qwidgetintdict.h>
++#include <kglobal.h>
+
+ // resolve the conflict between X11's FocusIn and QEvent::FocusIn
+ const int XFocusOut = FocusOut;
+@@ -66,7 +70,7 @@
+
+ QIntDict<QSocketNotifier> socknotDict;
+ bool activate_timers;
+- int timerid;
++ XtIntervalId timerid;
+
+ // arguments for Xt display initialization
+ const char* applicationClass;
+@@ -104,7 +108,7 @@
+
+ QXtEventLoopPrivate::QXtEventLoopPrivate()
+ : appContext(NULL), ownContext(NULL),
+- activate_timers(FALSE), timerid(-1)
++ activate_timers(FALSE), timerid(0)
+ {
+ }
+
+@@ -409,7 +413,7 @@
+ void qmotif_timeout_handler( XtPointer, XtIntervalId * )
+ {
+ static_d->activate_timers = TRUE;
+- static_d->timerid = -1;
++ static_d->timerid = 0;
+ }
+
+ /*! \reimp
+@@ -422,10 +426,10 @@
+
+ // make sure we fire off Qt's timers
+ int ttw = timeToWait();
+- if ( d->timerid != -1 ) {
++ if ( d->timerid != 0 ) {
+ XtRemoveTimeOut( d->timerid );
+ }
+- d->timerid = -1;
++ d->timerid = 0;
+ if ( ttw != -1 ) {
+ d->timerid =
+ XtAppAddTimeOut( d->appContext, ttw,
More information about the pkg-kde-commits
mailing list