~nik90/ubuntu/precise/vlc/keywords

« back to all changes in this revision

Viewing changes to projects/mozilla/support/npunix.cpp

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-02-13 01:34:02 UTC
  • mfrom: (1.1.44)
  • Revision ID: package-import@ubuntu.com-20120213013402-7utx6r7s9dg3r0pf
Tags: 2.0.0~unix-0ubuntu1
* New upstream release (Closes: #499381, #573064, #624027, LP: #455825,
  #573775, #695882, #705151, #708448, #738381, #743581, #747757, #817924,
  #931083).
* Remove dropped mozilla-plugin-vlc, vlc-plugin-ggi, and vlc-plugin-svgalib.
  The Mozilla browser plug-in is now provided by a separate source tarball.
* Add new plugins to and remove dropped plugins from vlc-nox.
* Add new and remove dropped build dependencies:
  + libbluray-dev (for Blu-ray support)
  + libresid-builder-dev
  + libsamplerate0-dev
  + libsidplay2-dev
  + lbspeexdsp-dev
  + libxcb-composite0-dev
  - libgtk2.0-dev
  - xulrunner-dev
* vlc-plugin-fluidsynth depends on fluid-soundfont-gm or
  musescore-soundfont-gm for having a sound font for playing MIDI files.
* Drop all patches (they were either backported or accepted by upstream).
* Update symbols for libvlc5.
* Install plugins.dat instead of running vlc-cache-gen in postinst.
* Update minimum version of build dependencies.
* Change Build-Dependency from libupnp3-dev to unversioned libupnp-dev.
  (Closes: #656831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
 
 *
3
 
 * Mozilla/Firefox plugin for VLC
4
 
 * Copyright (C) 2009, Jean-Paul Saman <jpsaman@videolan.org>
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Lesser General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2.1 of the License, or (at your option) any later version.
10
 
 *
11
 
 * This library is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Lesser General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this library; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 *
20
 
 * The Original Code is mozilla.org code.
21
 
 *
22
 
 * The Initial Developer of the Original Code is
23
 
 * Netscape Communications Corporation.
24
 
 * Portions created by the Initial Developer are Copyright (C) 1998
25
 
 * the Initial Developer. All Rights Reserved.
26
 
 *
27
 
 * Contributor(s):
28
 
 *   Stephen Mak <smak@sun.com>
29
 
 *
30
 
 */
31
 
 
32
 
/*
33
 
 * npunix.c
34
 
 *
35
 
 * Netscape Client Plugin API
36
 
 * - Wrapper function to interface with the Netscape Navigator
37
 
 *
38
 
 * dp Suresh <dp@netscape.com>
39
 
 *
40
 
 *----------------------------------------------------------------------
41
 
 * PLUGIN DEVELOPERS:
42
 
 *  YOU WILL NOT NEED TO EDIT THIS FILE.
43
 
 *----------------------------------------------------------------------
44
 
 */
45
 
 
46
 
#ifdef HAVE_CONFIG_H
47
 
# include "config.h"
48
 
#endif
49
 
 
50
 
#define XP_UNIX 1
51
 
 
52
 
#include <npapi.h>
53
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
54
 
#include "npupp.h" 
55
 
#else
56
 
#include "npfunctions.h"
57
 
#endif
58
 
 
59
 
#include "../vlcshell.h"
60
 
 
61
 
/*
62
 
 * Define PLUGIN_TRACE to have the wrapper functions print
63
 
 * messages to stderr whenever they are called.
64
 
 */
65
 
 
66
 
#ifdef PLUGIN_TRACE
67
 
#include <stdio.h>
68
 
#define PLUGINDEBUGSTR(msg) fprintf(stderr, "%s\n", msg)
69
 
#else
70
 
#define PLUGINDEBUGSTR(msg)
71
 
#endif
72
 
 
73
 
/***********************************************************************
74
 
 *
75
 
 * Globals
76
 
 *
77
 
 ***********************************************************************/
78
 
 
79
 
static NPNetscapeFuncs   gNetscapeFuncs;    /* Netscape Function table */
80
 
 
81
 
/***********************************************************************
82
 
 *
83
 
 * Wrapper functions : plugin calling Netscape Navigator
84
 
 *
85
 
 * These functions let the plugin developer just call the APIs
86
 
 * as documented and defined in npapi.h, without needing to know
87
 
 * about the function table and call macros in npupp.h.
88
 
 *
89
 
 ***********************************************************************/
90
 
 
91
 
void
92
 
NPN_Version(int* plugin_major, int* plugin_minor,
93
 
         int* netscape_major, int* netscape_minor)
94
 
{
95
 
    *plugin_major = NP_VERSION_MAJOR;
96
 
    *plugin_minor = NP_VERSION_MINOR;
97
 
 
98
 
    /* Major version is in high byte */
99
 
    *netscape_major = gNetscapeFuncs.version >> 8;
100
 
    /* Minor version is in low byte */
101
 
    *netscape_minor = gNetscapeFuncs.version & 0xFF;
102
 
}
103
 
 
104
 
void
105
 
NPN_PluginThreadAsyncCall(NPP plugin,
106
 
                          void (*func)(void *),
107
 
                          void *userData)
108
 
{
109
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) >= 20)
110
 
    return (*gNetscapeFuncs.pluginthreadasynccall)(plugin, func, userData);
111
 
#endif
112
 
}
113
 
 
114
 
NPError
115
 
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value)
116
 
{
117
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
118
 
    return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
119
 
                    instance, variable, r_value);
120
 
#else
121
 
    return (*gNetscapeFuncs.getvalue)(instance, variable, r_value);
122
 
#endif
123
 
}
124
 
 
125
 
NPError
126
 
NPN_SetValue(NPP instance, NPPVariable variable, void *value)
127
 
{
128
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
129
 
    return CallNPN_SetValueProc(gNetscapeFuncs.setvalue,
130
 
                    instance, variable, value);
131
 
#else
132
 
    return (*gNetscapeFuncs.setvalue)(instance, variable, value);
133
 
#endif
134
 
}
135
 
 
136
 
NPError
137
 
NPN_GetURL(NPP instance, const char* url, const char* window)
138
 
{
139
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
140
 
    return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
141
 
#else
142
 
    return (*gNetscapeFuncs.geturl)(instance, url, window);
143
 
#endif
144
 
}
145
 
 
146
 
NPError
147
 
NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
148
 
{
149
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
150
 
    return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
151
 
#else
152
 
    return (*gNetscapeFuncs.geturlnotify)(instance, url, window, notifyData);
153
 
#endif
154
 
}
155
 
 
156
 
NPError
157
 
NPN_PostURL(NPP instance, const char* url, const char* window,
158
 
         uint32_t len, const char* buf, NPBool file)
159
 
{
160
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
161
 
    return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
162
 
                    url, window, len, buf, file);
163
 
#else
164
 
    return (*gNetscapeFuncs.posturl)(instance, url, window, len, buf, file);
165
 
#endif
166
 
}
167
 
 
168
 
NPError
169
 
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
170
 
                  const char* buf, NPBool file, void* notifyData)
171
 
{
172
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
173
 
    return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
174
 
            instance, url, window, len, buf, file, notifyData);
175
 
#else
176
 
    return (*gNetscapeFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData);
177
 
 
178
 
#endif
179
 
}
180
 
 
181
 
NPError
182
 
NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
183
 
{
184
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
185
 
    return CallNPN_RequestReadProc(gNetscapeFuncs.requestread,
186
 
                    stream, rangeList);
187
 
#else
188
 
    return (*gNetscapeFuncs.requestread)(stream, rangeList);
189
 
#endif
190
 
}
191
 
 
192
 
NPError
193
 
NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
194
 
          NPStream** stream_ptr)
195
 
{
196
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
197
 
    return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
198
 
                    type, window, stream_ptr);
199
 
#else
200
 
    return (*gNetscapeFuncs.newstream)(instance, type, window, stream_ptr);
201
 
#endif
202
 
}
203
 
 
204
 
int32_t
205
 
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
206
 
{
207
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
208
 
    return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
209
 
                    stream, len, buffer);
210
 
#else
211
 
    return (*gNetscapeFuncs.write)(instance, stream, len, buffer);
212
 
#endif
213
 
}
214
 
 
215
 
NPError
216
 
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
217
 
{
218
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
219
 
    return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
220
 
                        instance, stream, reason);
221
 
#else
222
 
    return (*gNetscapeFuncs.destroystream)(instance, stream, reason);
223
 
#endif
224
 
}
225
 
 
226
 
void
227
 
NPN_Status(NPP instance, const char* message)
228
 
{
229
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
230
 
    CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
231
 
#else
232
 
    (*gNetscapeFuncs.status)(instance, message);
233
 
#endif
234
 
}
235
 
 
236
 
const char*
237
 
NPN_UserAgent(NPP instance)
238
 
{
239
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
240
 
    return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
241
 
#else
242
 
    return (*gNetscapeFuncs.uagent)(instance);
243
 
#endif
244
 
}
245
 
 
246
 
void *NPN_MemAlloc(uint32_t size)
247
 
{
248
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
249
 
    return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
250
 
#else
251
 
    return (*gNetscapeFuncs.memalloc)(size);
252
 
#endif
253
 
}
254
 
 
255
 
void NPN_MemFree(void* ptr)
256
 
{
257
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
258
 
    CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
259
 
#else
260
 
    (*gNetscapeFuncs.memfree)(ptr);
261
 
#endif
262
 
}
263
 
 
264
 
uint32_t NPN_MemFlush(uint32_t size)
265
 
{
266
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
267
 
    return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
268
 
#else
269
 
    return (*gNetscapeFuncs.memflush)(size);
270
 
#endif
271
 
}
272
 
 
273
 
void NPN_ReloadPlugins(NPBool reloadPages)
274
 
{
275
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
276
 
    CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
277
 
#else
278
 
    (*gNetscapeFuncs.reloadplugins)(reloadPages);
279
 
#endif
280
 
}
281
 
 
282
 
#ifdef OJI
283
 
JRIEnv* NPN_GetJavaEnv()
284
 
{
285
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
286
 
    return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv);
287
 
#else
288
 
    return (*gNetscapeFuncs.getJavaEnv);
289
 
#endif
290
 
}
291
 
 
292
 
jref NPN_GetJavaPeer(NPP instance)
293
 
{
294
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
295
 
    return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer,
296
 
                       instance);
297
 
#else
298
 
    return (*gNetscapeFuncs.getJavaPeer)(instance);
299
 
#endif
300
 
}
301
 
#endif
302
 
 
303
 
void
304
 
NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
305
 
{
306
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
307
 
    CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance,
308
 
        invalidRect);
309
 
#else
310
 
    (*gNetscapeFuncs.invalidaterect)(instance, invalidRect);
311
 
#endif
312
 
}
313
 
 
314
 
void
315
 
NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
316
 
{
317
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
318
 
    CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance,
319
 
        invalidRegion);
320
 
#else
321
 
    (*gNetscapeFuncs.invalidateregion)(instance, invalidRegion);
322
 
#endif
323
 
}
324
 
 
325
 
void
326
 
NPN_ForceRedraw(NPP instance)
327
 
{
328
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
329
 
    CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance);
330
 
#else
331
 
    (*gNetscapeFuncs.forceredraw)(instance);
332
 
#endif
333
 
}
334
 
 
335
 
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
336
 
{
337
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
338
 
    CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate,
339
 
        instance, enabled);
340
 
#else
341
 
    (*gNetscapeFuncs.pushpopupsenabledstate)(instance, enabled);
342
 
#endif
343
 
}
344
 
 
345
 
void NPN_PopPopupsEnabledState(NPP instance)
346
 
{
347
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
348
 
    CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs.poppopupsenabledstate,
349
 
        instance);
350
 
#else
351
 
    (*gNetscapeFuncs.poppopupsenabledstate)(instance);
352
 
#endif
353
 
}
354
 
 
355
 
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
356
 
{
357
 
    int minor = gNetscapeFuncs.version & 0xFF;
358
 
    if( minor >= 14 )
359
 
    {
360
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
361
 
        return CallNPN_GetStringIdentifierProc(
362
 
                        gNetscapeFuncs.getstringidentifier, name);
363
 
#else
364
 
        return (*gNetscapeFuncs.getstringidentifier)(name);
365
 
#endif
366
 
    }
367
 
    return NULL;
368
 
}
369
 
 
370
 
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
371
 
                              NPIdentifier *identifiers)
372
 
{
373
 
    int minor = gNetscapeFuncs.version & 0xFF;
374
 
    if( minor >= 14 )
375
 
    {
376
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
377
 
        CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers,
378
 
                                         names, nameCount, identifiers);
379
 
#else
380
 
        (*gNetscapeFuncs.getstringidentifiers)(names, nameCount, identifiers);
381
 
#endif
382
 
    }
383
 
}
384
 
 
385
 
NPIdentifier NPN_GetIntIdentifier(int32_t intid)
386
 
{
387
 
    int minor = gNetscapeFuncs.version & 0xFF;
388
 
    if( minor >= 14 )
389
 
    {
390
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
391
 
        return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid);
392
 
#else
393
 
        return (*gNetscapeFuncs.getintidentifier)(intid);
394
 
#endif
395
 
    }
396
 
    return NULL;
397
 
}
398
 
 
399
 
bool NPN_IdentifierIsString(NPIdentifier identifier)
400
 
{
401
 
    int minor = gNetscapeFuncs.version & 0xFF;
402
 
    if( minor >= 14 )
403
 
    {
404
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
405
 
        return CallNPN_IdentifierIsStringProc(
406
 
                        gNetscapeFuncs.identifierisstring,
407
 
                        identifier);
408
 
#else
409
 
        return (*gNetscapeFuncs.identifierisstring)(identifier);
410
 
#endif
411
 
    }
412
 
    return false;
413
 
}
414
 
 
415
 
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
416
 
{
417
 
    int minor = gNetscapeFuncs.version & 0xFF;
418
 
    if( minor >= 14 )
419
 
    {
420
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
421
 
        return CallNPN_UTF8FromIdentifierProc(
422
 
                            gNetscapeFuncs.utf8fromidentifier,
423
 
                            identifier);
424
 
#else
425
 
        return (*gNetscapeFuncs.utf8fromidentifier)(identifier);
426
 
#endif
427
 
    }
428
 
    return NULL;
429
 
}
430
 
 
431
 
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
432
 
{
433
 
    int minor = gNetscapeFuncs.version & 0xFF;
434
 
    if( minor >= 14 )
435
 
    {
436
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
437
 
        return CallNPN_IntFromIdentifierProc(
438
 
                        gNetscapeFuncs.intfromidentifier,
439
 
                        identifier);
440
 
#else
441
 
        return (*gNetscapeFuncs.intfromidentifier)(identifier);
442
 
#endif
443
 
    }
444
 
    return 0;
445
 
}
446
 
 
447
 
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
448
 
{
449
 
    int minor = gNetscapeFuncs.version & 0xFF;
450
 
    if( minor >= 14 )
451
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
452
 
        return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass);
453
 
#else
454
 
        return (*gNetscapeFuncs.createobject)(npp, aClass);
455
 
#endif
456
 
    return NULL;
457
 
}
458
 
 
459
 
NPObject *NPN_RetainObject(NPObject *obj)
460
 
{
461
 
    int minor = gNetscapeFuncs.version & 0xFF;
462
 
    if( minor >= 14 )
463
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
464
 
        return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj);
465
 
#else
466
 
        return (*gNetscapeFuncs.retainobject)(obj);
467
 
#endif
468
 
    return NULL;
469
 
}
470
 
 
471
 
void NPN_ReleaseObject(NPObject *obj)
472
 
{
473
 
    int minor = gNetscapeFuncs.version & 0xFF;
474
 
    if( minor >= 14 )
475
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
476
 
        CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj);
477
 
#else
478
 
        (*gNetscapeFuncs.releaseobject)(obj);
479
 
#endif
480
 
}
481
 
 
482
 
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
483
 
                const NPVariant *args, uint32_t argCount, NPVariant *result)
484
 
{
485
 
    int minor = gNetscapeFuncs.version & 0xFF;
486
 
    if( minor >= 14 )
487
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
488
 
        return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName,
489
 
                                  args, argCount, result);
490
 
#else
491
 
        return (*gNetscapeFuncs.invoke)(npp, obj, methodName, args, argCount, result);
492
 
#endif
493
 
    return false;
494
 
}
495
 
 
496
 
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
497
 
                       uint32_t argCount, NPVariant *result)
498
 
{
499
 
    int minor = gNetscapeFuncs.version & 0xFF;
500
 
    if( minor >= 14 )
501
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
502
 
        return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj,
503
 
                                         args, argCount, result);
504
 
#else
505
 
        return (*gNetscapeFuncs.invokeDefault)(npp, obj, args, argCount, result);
506
 
#endif
507
 
    return false;
508
 
}
509
 
 
510
 
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
511
 
                  NPVariant *result)
512
 
{
513
 
    int minor = gNetscapeFuncs.version & 0xFF;
514
 
    if( minor >= 14 )
515
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
516
 
        return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj,
517
 
                                    script, result);
518
 
#else
519
 
        return (*gNetscapeFuncs.evaluate)(npp, obj, script, result);
520
 
#endif
521
 
    return false;
522
 
}
523
 
 
524
 
bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
525
 
                     NPVariant *result)
526
 
{
527
 
    int minor = gNetscapeFuncs.version & 0xFF;
528
 
    if( minor >= 14 )
529
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
530
 
        return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj,
531
 
                                       propertyName, result);
532
 
#else
533
 
        return (*gNetscapeFuncs.getproperty)(npp, obj, propertyName, result);
534
 
#endif
535
 
    return false;
536
 
}
537
 
 
538
 
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
539
 
                     const NPVariant *value)
540
 
{
541
 
    int minor = gNetscapeFuncs.version & 0xFF;
542
 
    if( minor >= 14 )
543
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
544
 
        return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj,
545
 
                                       propertyName, value);
546
 
#else
547
 
        return (*gNetscapeFuncs.setproperty)(npp, obj, propertyName, value);
548
 
#endif
549
 
    return false;
550
 
}
551
 
 
552
 
bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
553
 
{
554
 
    int minor = gNetscapeFuncs.version & 0xFF;
555
 
    if( minor >= 14 )
556
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
557
 
        return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj,
558
 
                                          propertyName);
559
 
#else
560
 
        return (*gNetscapeFuncs.removeproperty)(npp, obj, propertyName);
561
 
#endif
562
 
    return false;
563
 
}
564
 
 
565
 
bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
566
 
{
567
 
    int minor = gNetscapeFuncs.version & 0xFF;
568
 
    if( minor >= 14 )
569
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
570
 
        return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj,
571
 
                                       propertyName);
572
 
#else
573
 
        return (*gNetscapeFuncs.hasproperty)(npp, obj, propertyName);
574
 
#endif
575
 
    return false;
576
 
}
577
 
 
578
 
bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
579
 
{
580
 
    int minor = gNetscapeFuncs.version & 0xFF;
581
 
    if( minor >= 14 )
582
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
583
 
        return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp,
584
 
                                     obj, methodName);
585
 
#else
586
 
        return (*gNetscapeFuncs.hasmethod)(npp, obj, methodName);
587
 
#endif
588
 
    return false;
589
 
}
590
 
 
591
 
void NPN_ReleaseVariantValue(NPVariant *variant)
592
 
{
593
 
    int minor = gNetscapeFuncs.version & 0xFF;
594
 
    if( minor >= 14 )
595
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
596
 
        CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant);
597
 
#else
598
 
        (*gNetscapeFuncs.releasevariantvalue)(variant);
599
 
#endif
600
 
}
601
 
 
602
 
void NPN_SetException(NPObject* obj, const NPUTF8 *message)
603
 
{
604
 
    int minor = gNetscapeFuncs.version & 0xFF;
605
 
    if( minor >= 14 )
606
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
607
 
        CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message);
608
 
#else
609
 
        (*gNetscapeFuncs.setexception)(obj, message);
610
 
#endif
611
 
}
612
 
 
613
 
/***********************************************************************
614
 
 *
615
 
 * Wrapper functions : Netscape Navigator -> plugin
616
 
 *
617
 
 * These functions let the plugin developer just create the APIs
618
 
 * as documented and defined in npapi.h, without needing to 
619
 
 * install those functions in the function table or worry about
620
 
 * setting up globals for 68K plugins.
621
 
 *
622
 
 ***********************************************************************/
623
 
 
624
 
/* Function prototypes */
625
 
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
626
 
        int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
627
 
NPError Private_Destroy(NPP instance, NPSavedData** save);
628
 
NPError Private_SetWindow(NPP instance, NPWindow* window);
629
 
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
630
 
                          NPBool seekable, uint16_t* stype);
631
 
int32_t Private_WriteReady(NPP instance, NPStream* stream);
632
 
int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset,
633
 
                    int32_t len, void* buffer);
634
 
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
635
 
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
636
 
void Private_URLNotify(NPP instance, const char* url,
637
 
                       NPReason reason, void* notifyData);
638
 
void Private_Print(NPP instance, NPPrint* platformPrint);
639
 
NPError Private_GetValue(NPP instance, NPPVariable variable, void *r_value);
640
 
NPError Private_SetValue(NPP instance, NPNVariable variable, void *r_value);
641
 
#ifdef OJI
642
 
JRIGlobalRef Private_GetJavaClass(void);
643
 
#endif
644
 
 
645
 
/* function implementations */
646
 
NPError
647
 
Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
648
 
        int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
649
 
{
650
 
    NPError ret;
651
 
    PLUGINDEBUGSTR("New");
652
 
    ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
653
 
    return ret; 
654
 
}
655
 
 
656
 
NPError
657
 
Private_Destroy(NPP instance, NPSavedData** save)
658
 
{
659
 
    PLUGINDEBUGSTR("Destroy");
660
 
    return NPP_Destroy(instance, save);
661
 
}
662
 
 
663
 
NPError
664
 
Private_SetWindow(NPP instance, NPWindow* window)
665
 
{
666
 
    NPError err;
667
 
    PLUGINDEBUGSTR("SetWindow");
668
 
    err = NPP_SetWindow(instance, window);
669
 
    return err;
670
 
}
671
 
 
672
 
NPError
673
 
Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
674
 
            NPBool seekable, uint16_t* stype)
675
 
{
676
 
    NPError err;
677
 
    PLUGINDEBUGSTR("NewStream");
678
 
    err = NPP_NewStream(instance, type, stream, seekable, stype);
679
 
    return err;
680
 
}
681
 
 
682
 
int32_t
683
 
Private_WriteReady(NPP instance, NPStream* stream)
684
 
{
685
 
    unsigned int result;
686
 
    PLUGINDEBUGSTR("WriteReady");
687
 
    result = NPP_WriteReady(instance, stream);
688
 
    return result;
689
 
}
690
 
 
691
 
int32_t
692
 
Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
693
 
        void* buffer)
694
 
{
695
 
    unsigned int result;
696
 
    PLUGINDEBUGSTR("Write");
697
 
    result = NPP_Write(instance, stream, offset, len, buffer);
698
 
    return result;
699
 
}
700
 
 
701
 
void
702
 
Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
703
 
{
704
 
    PLUGINDEBUGSTR("StreamAsFile");
705
 
    NPP_StreamAsFile(instance, stream, fname);
706
 
}
707
 
 
708
 
 
709
 
NPError
710
 
Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
711
 
{
712
 
    NPError err;
713
 
    PLUGINDEBUGSTR("DestroyStream");
714
 
    err = NPP_DestroyStream(instance, stream, reason);
715
 
    return err;
716
 
}
717
 
 
718
 
void
719
 
Private_URLNotify(NPP instance, const char* url,
720
 
                NPReason reason, void* notifyData)
721
 
{
722
 
    PLUGINDEBUGSTR("URLNotify");
723
 
    NPP_URLNotify(instance, url, reason, notifyData);
724
 
}
725
 
 
726
 
void
727
 
Private_Print(NPP instance, NPPrint* platformPrint)
728
 
{
729
 
    PLUGINDEBUGSTR("Print");
730
 
    NPP_Print(instance, platformPrint);
731
 
}
732
 
 
733
 
NPError
734
 
Private_GetValue(NPP instance, NPPVariable variable, void *r_value)
735
 
{
736
 
    PLUGINDEBUGSTR("GetValue");
737
 
    return NPP_GetValue(instance, variable, r_value);
738
 
}
739
 
 
740
 
NPError
741
 
Private_SetValue(NPP instance, NPNVariable variable, void *r_value)
742
 
{
743
 
    PLUGINDEBUGSTR("SetValue");
744
 
    return NPP_SetValue(instance, variable, r_value);
745
 
}
746
 
 
747
 
#ifdef OJI
748
 
JRIGlobalRef
749
 
Private_GetJavaClass(void)
750
 
{
751
 
    jref clazz = NPP_GetJavaClass();
752
 
    if (clazz) {
753
 
    JRIEnv* env = NPN_GetJavaEnv();
754
 
    return JRI_NewGlobalRef(env, clazz);
755
 
    }
756
 
    return NULL;
757
 
}
758
 
#endif
759
 
 
760
 
/*********************************************************************** 
761
 
 *
762
 
 * These functions are located automagically by netscape.
763
 
 *
764
 
 ***********************************************************************/
765
 
 
766
 
/*
767
 
 * NP_GetMIMEDescription
768
 
 *  - Netscape needs to know about this symbol
769
 
 *  - Netscape uses the return value to identify when an object instance
770
 
 *    of this plugin should be created.
771
 
 */
772
 
NPP_GET_MIME_CONST char *
773
 
NP_GetMIMEDescription(void)
774
 
{
775
 
    return NPP_GetMIMEDescription();
776
 
}
777
 
 
778
 
/*
779
 
 * NP_GetValue [optional]
780
 
 *  - Netscape needs to know about this symbol.
781
 
 *  - Interfaces with plugin to get values for predefined variables
782
 
 *    that the navigator needs.
783
 
 */
784
 
NPError
785
 
NP_GetValue(void* future, NPPVariable variable, void *value)
786
 
{
787
 
    return NPP_GetValue((NPP)future, variable, value);
788
 
}
789
 
 
790
 
/*
791
 
 * NP_Initialize
792
 
 *  - Netscape needs to know about this symbol.
793
 
 *  - It calls this function after looking up its symbol before it
794
 
 *    is about to create the first ever object of this kind.
795
 
 *
796
 
 * PARAMETERS
797
 
 *    nsTable   - The netscape function table. If developers just use these
798
 
 *        wrappers, they don't need to worry about all these function
799
 
 *        tables.
800
 
 * RETURN
801
 
 *    pluginFuncs
802
 
 *      - This functions needs to fill the plugin function table
803
 
 *        pluginFuncs and return it. Netscape Navigator plugin
804
 
 *        library will use this function table to call the plugin.
805
 
 *
806
 
 */
807
 
NPError
808
 
NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
809
 
{
810
 
    NPError err = NPERR_NO_ERROR;
811
 
 
812
 
    PLUGINDEBUGSTR("NP_Initialize");
813
 
 
814
 
    /* validate input parameters */
815
 
    if ((nsTable == NULL) || (pluginFuncs == NULL))
816
 
        err = NPERR_INVALID_FUNCTABLE_ERROR;
817
 
 
818
 
    /*
819
 
     * Check the major version passed in Netscape's function table.
820
 
     * We won't load if the major version is newer than what we expect.
821
 
     * Also check that the function tables passed in are big enough for
822
 
     * all the functions we need (they could be bigger, if Netscape added
823
 
     * new APIs, but that's OK with us -- we'll just ignore them).
824
 
     *
825
 
     */
826
 
    if (err == NPERR_NO_ERROR) {
827
 
        if ((nsTable->version >> 8) > NP_VERSION_MAJOR)
828
 
            err = NPERR_INCOMPATIBLE_VERSION_ERROR;
829
 
        if (nsTable->size < ((char *)&nsTable->posturlnotify - (char *)nsTable))
830
 
            err = NPERR_INVALID_FUNCTABLE_ERROR;
831
 
        if (pluginFuncs->size < sizeof(NPPluginFuncs))
832
 
            err = NPERR_INVALID_FUNCTABLE_ERROR;
833
 
    }
834
 
 
835
 
    if (err == NPERR_NO_ERROR)
836
 
    {
837
 
        /*
838
 
         * Copy all the fields of Netscape function table into our
839
 
         * copy so we can call back into Netscape later.  Note that
840
 
         * we need to copy the fields one by one, rather than assigning
841
 
         * the whole structure, because the Netscape function table
842
 
         * could actually be bigger than what we expect.
843
 
         */
844
 
        int minor = nsTable->version & 0xFF;
845
 
 
846
 
        gNetscapeFuncs.version       = nsTable->version;
847
 
        gNetscapeFuncs.size          = nsTable->size;
848
 
        gNetscapeFuncs.posturl       = nsTable->posturl;
849
 
        gNetscapeFuncs.geturl        = nsTable->geturl;
850
 
        gNetscapeFuncs.requestread   = nsTable->requestread;
851
 
        gNetscapeFuncs.newstream     = nsTable->newstream;
852
 
        gNetscapeFuncs.write         = nsTable->write;
853
 
        gNetscapeFuncs.destroystream = nsTable->destroystream;
854
 
        gNetscapeFuncs.status        = nsTable->status;
855
 
        gNetscapeFuncs.uagent        = nsTable->uagent;
856
 
        gNetscapeFuncs.memalloc      = nsTable->memalloc;
857
 
        gNetscapeFuncs.memfree       = nsTable->memfree;
858
 
        gNetscapeFuncs.memflush      = nsTable->memflush;
859
 
        gNetscapeFuncs.reloadplugins = nsTable->reloadplugins;
860
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) >= 20)
861
 
        gNetscapeFuncs.pluginthreadasynccall =
862
 
            nsTable->pluginthreadasynccall;
863
 
#endif
864
 
#ifdef OJI
865
 
        if( minor >= NPVERS_HAS_LIVECONNECT )
866
 
        {
867
 
            gNetscapeFuncs.getJavaEnv    = nsTable->getJavaEnv;
868
 
            gNetscapeFuncs.getJavaPeer   = nsTable->getJavaPeer;
869
 
        }
870
 
#endif
871
 
        gNetscapeFuncs.getvalue      = nsTable->getvalue;
872
 
        gNetscapeFuncs.setvalue      = nsTable->setvalue;
873
 
 
874
 
        if( minor >= NPVERS_HAS_NOTIFICATION )
875
 
        {
876
 
            gNetscapeFuncs.geturlnotify  = nsTable->geturlnotify;
877
 
            gNetscapeFuncs.posturlnotify = nsTable->posturlnotify;
878
 
        }
879
 
 
880
 
        if (nsTable->size >= ((char *)&nsTable->setexception - (char *)nsTable))
881
 
        {
882
 
            gNetscapeFuncs.invalidaterect = nsTable->invalidaterect;
883
 
            gNetscapeFuncs.invalidateregion = nsTable->invalidateregion;
884
 
            gNetscapeFuncs.forceredraw = nsTable->forceredraw;
885
 
            /* npruntime support */
886
 
            if (minor >= 14)
887
 
            {
888
 
                gNetscapeFuncs.getstringidentifier = nsTable->getstringidentifier;
889
 
                gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers;
890
 
                gNetscapeFuncs.getintidentifier = nsTable->getintidentifier;
891
 
                gNetscapeFuncs.identifierisstring = nsTable->identifierisstring;
892
 
                gNetscapeFuncs.utf8fromidentifier = nsTable->utf8fromidentifier;
893
 
                gNetscapeFuncs.intfromidentifier = nsTable->intfromidentifier;
894
 
                gNetscapeFuncs.createobject = nsTable->createobject;
895
 
                gNetscapeFuncs.retainobject = nsTable->retainobject;
896
 
                gNetscapeFuncs.releaseobject = nsTable->releaseobject;
897
 
                gNetscapeFuncs.invoke = nsTable->invoke;
898
 
                gNetscapeFuncs.invokeDefault = nsTable->invokeDefault;
899
 
                gNetscapeFuncs.evaluate = nsTable->evaluate;
900
 
                gNetscapeFuncs.getproperty = nsTable->getproperty;
901
 
                gNetscapeFuncs.setproperty = nsTable->setproperty;
902
 
                gNetscapeFuncs.removeproperty = nsTable->removeproperty;
903
 
                gNetscapeFuncs.hasproperty = nsTable->hasproperty;
904
 
                gNetscapeFuncs.hasmethod = nsTable->hasmethod;
905
 
                gNetscapeFuncs.releasevariantvalue = nsTable->releasevariantvalue;
906
 
                gNetscapeFuncs.setexception = nsTable->setexception;
907
 
            }
908
 
        }
909
 
        else
910
 
        {
911
 
            gNetscapeFuncs.invalidaterect = NULL;
912
 
            gNetscapeFuncs.invalidateregion = NULL;
913
 
            gNetscapeFuncs.forceredraw = NULL;
914
 
            gNetscapeFuncs.getstringidentifier = NULL;
915
 
            gNetscapeFuncs.getstringidentifiers = NULL;
916
 
            gNetscapeFuncs.getintidentifier = NULL;
917
 
            gNetscapeFuncs.identifierisstring = NULL;
918
 
            gNetscapeFuncs.utf8fromidentifier = NULL;
919
 
            gNetscapeFuncs.intfromidentifier = NULL;
920
 
            gNetscapeFuncs.createobject = NULL;
921
 
            gNetscapeFuncs.retainobject = NULL;
922
 
            gNetscapeFuncs.releaseobject = NULL;
923
 
            gNetscapeFuncs.invoke = NULL;
924
 
            gNetscapeFuncs.invokeDefault = NULL;
925
 
            gNetscapeFuncs.evaluate = NULL;
926
 
            gNetscapeFuncs.getproperty = NULL;
927
 
            gNetscapeFuncs.setproperty = NULL;
928
 
            gNetscapeFuncs.removeproperty = NULL;
929
 
            gNetscapeFuncs.hasproperty = NULL;
930
 
            gNetscapeFuncs.releasevariantvalue = NULL;
931
 
            gNetscapeFuncs.setexception = NULL;
932
 
        }
933
 
        if (nsTable->size >=
934
 
            ((char *)&nsTable->poppopupsenabledstate - (char *)nsTable))
935
 
        {
936
 
            gNetscapeFuncs.pushpopupsenabledstate = nsTable->pushpopupsenabledstate;
937
 
            gNetscapeFuncs.poppopupsenabledstate  = nsTable->poppopupsenabledstate;
938
 
        }
939
 
        else
940
 
        {
941
 
            gNetscapeFuncs.pushpopupsenabledstate = NULL;
942
 
            gNetscapeFuncs.poppopupsenabledstate  = NULL;
943
 
        }
944
 
 
945
 
        /*
946
 
         * Set up the plugin function table that Netscape will use to
947
 
         * call us.  Netscape needs to know about our version and size
948
 
         * and have a UniversalProcPointer for every function we
949
 
         * implement.
950
 
         */
951
 
        pluginFuncs->version    = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
952
 
        pluginFuncs->size       = sizeof(NPPluginFuncs);
953
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
954
 
        pluginFuncs->newp       = NewNPP_NewProc(Private_New);
955
 
        pluginFuncs->destroy    = NewNPP_DestroyProc(Private_Destroy);
956
 
        pluginFuncs->setwindow  = NewNPP_SetWindowProc(Private_SetWindow);
957
 
        pluginFuncs->newstream  = NewNPP_NewStreamProc(Private_NewStream);
958
 
        pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
959
 
        pluginFuncs->asfile     = NewNPP_StreamAsFileProc(Private_StreamAsFile);
960
 
        pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
961
 
        pluginFuncs->write      = NewNPP_WriteProc(Private_Write);
962
 
        pluginFuncs->print      = NewNPP_PrintProc(Private_Print);
963
 
        pluginFuncs->getvalue   = NewNPP_GetValueProc(Private_GetValue);
964
 
        pluginFuncs->setvalue   = NewNPP_SetValueProc(Private_SetValue);
965
 
#else
966
 
        pluginFuncs->newp       = (NPP_NewProcPtr)(Private_New);
967
 
        pluginFuncs->destroy    = (NPP_DestroyProcPtr)(Private_Destroy);
968
 
        pluginFuncs->setwindow  = (NPP_SetWindowProcPtr)(Private_SetWindow);
969
 
        pluginFuncs->newstream  = (NPP_NewStreamProcPtr)(Private_NewStream);
970
 
        pluginFuncs->destroystream = (NPP_DestroyStreamProcPtr)(Private_DestroyStream);
971
 
        pluginFuncs->asfile     = (NPP_StreamAsFileProcPtr)(Private_StreamAsFile);
972
 
        pluginFuncs->writeready = (NPP_WriteReadyProcPtr)(Private_WriteReady);
973
 
        pluginFuncs->write      = (NPP_WriteProcPtr)(Private_Write);
974
 
        pluginFuncs->print      = (NPP_PrintProcPtr)(Private_Print);
975
 
        pluginFuncs->getvalue   = (NPP_GetValueProcPtr)(Private_GetValue);
976
 
        pluginFuncs->setvalue   = (NPP_SetValueProcPtr)(Private_SetValue);
977
 
#endif
978
 
        pluginFuncs->event      = NULL;
979
 
        if( minor >= NPVERS_HAS_NOTIFICATION )
980
 
        {
981
 
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
982
 
            pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
983
 
#else
984
 
            pluginFuncs->urlnotify = (NPP_URLNotifyProcPtr)(Private_URLNotify);
985
 
#endif
986
 
        }
987
 
#ifdef OJI
988
 
        if( minor >= NPVERS_HAS_LIVECONNECT )
989
 
            pluginFuncs->javaClass  = Private_GetJavaClass();
990
 
        else
991
 
            pluginFuncs->javaClass = NULL;
992
 
#else
993
 
        pluginFuncs->javaClass = NULL;
994
 
#endif
995
 
 
996
 
        err = NPP_Initialize();
997
 
    }
998
 
 
999
 
    return err;
1000
 
}
1001
 
 
1002
 
/*
1003
 
 * NP_Shutdown [optional]
1004
 
 *  - Netscape needs to know about this symbol.
1005
 
 *  - It calls this function after looking up its symbol after
1006
 
 *    the last object of this kind has been destroyed.
1007
 
 *
1008
 
 */
1009
 
NPError
1010
 
NP_Shutdown(void)
1011
 
{
1012
 
    PLUGINDEBUGSTR("NP_Shutdown");
1013
 
    NPP_Shutdown();
1014
 
    return NPERR_NO_ERROR;
1015
 
}