blob: b5aea95adf406dd62b974f154c2aa23ee877e8b2 [file] [log] [blame]
Grace Klobafbe47c02009-05-14 17:31:45 -07001/*
2 * Copyright 2008, The Android Open Source Project
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <stdlib.h>
27#include <string.h>
28#include <stdio.h>
29#include "main.h"
30#include "PluginObject.h"
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -040031#include "AnimationPlugin.h"
Derek Sollenbergerf42e2f42009-06-26 11:42:46 -040032#include "AudioPlugin.h"
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -040033#include "BackgroundPlugin.h"
Derek Sollenbergerdb398a72009-06-29 13:53:04 -040034#include "FormPlugin.h"
Derek Sollenberger4fb83e62009-07-27 16:40:13 -040035#include "PaintPlugin.h"
Grace Klobafbe47c02009-05-14 17:31:45 -070036#include "android_npapi.h"
37
38NPNetscapeFuncs* browser;
39#define EXPORT __attribute__((visibility("default")))
40
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040041NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
Grace Klobafbe47c02009-05-14 17:31:45 -070042 char* argn[], char* argv[], NPSavedData* saved);
43NPError NPP_Destroy(NPP instance, NPSavedData** save);
44NPError NPP_SetWindow(NPP instance, NPWindow* window);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040045NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
Grace Klobafbe47c02009-05-14 17:31:45 -070046 NPBool seekable, uint16* stype);
47NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
48int32 NPP_WriteReady(NPP instance, NPStream* stream);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040049int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
Grace Klobafbe47c02009-05-14 17:31:45 -070050 void* buffer);
51void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
52void NPP_Print(NPP instance, NPPrint* platformPrint);
53int16 NPP_HandleEvent(NPP instance, void* event);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040054void NPP_URLNotify(NPP instance, const char* URL, NPReason reason,
Grace Klobafbe47c02009-05-14 17:31:45 -070055 void* notifyData);
56NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value);
57NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value);
58
59extern "C" {
60EXPORT NPError NP_Initialize(NPNetscapeFuncs* browserFuncs, NPPluginFuncs* pluginFuncs, void *java_env, void *application_context);
61EXPORT NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
62EXPORT const char* NP_GetMIMEDescription(void);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040063EXPORT void NP_Shutdown(void);
Grace Klobafbe47c02009-05-14 17:31:45 -070064};
65
66ANPAudioTrackInterfaceV0 gSoundI;
Mike Reed224adad2009-06-10 10:24:01 -040067ANPBitmapInterfaceV0 gBitmapI;
Grace Klobafbe47c02009-05-14 17:31:45 -070068ANPCanvasInterfaceV0 gCanvasI;
69ANPLogInterfaceV0 gLogI;
70ANPPaintInterfaceV0 gPaintI;
71ANPPathInterfaceV0 gPathI;
Derek Sollenbergerc0f26572009-07-16 11:38:02 -040072ANPSurfaceInterfaceV0 gSurfaceI;
Grace Kloba9ffe5ac2009-08-04 17:51:06 -070073ANPSystemInterfaceV0 gSystemI;
Grace Klobafbe47c02009-05-14 17:31:45 -070074ANPTypefaceInterfaceV0 gTypefaceI;
Derek Sollenberger5b011e32009-06-22 11:39:40 -040075ANPWindowInterfaceV0 gWindowI;
Grace Klobafbe47c02009-05-14 17:31:45 -070076
77#define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0]))
Derek Sollenberger5b011e32009-06-22 11:39:40 -040078#define DEBUG_PLUGIN_EVENTS 0
Grace Klobafbe47c02009-05-14 17:31:45 -070079
80NPError NP_Initialize(NPNetscapeFuncs* browserFuncs, NPPluginFuncs* pluginFuncs, void *java_env, void *application_context)
81{
82 // Make sure we have a function table equal or larger than we are built against.
83 if (browserFuncs->size < sizeof(NPNetscapeFuncs)) {
84 return NPERR_GENERIC_ERROR;
85 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040086
Grace Klobafbe47c02009-05-14 17:31:45 -070087 // Copy the function table (structure)
88 browser = (NPNetscapeFuncs*) malloc(sizeof(NPNetscapeFuncs));
89 memcpy(browser, browserFuncs, sizeof(NPNetscapeFuncs));
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040090
Grace Klobafbe47c02009-05-14 17:31:45 -070091 // Build the plugin function table
92 pluginFuncs->version = 11;
93 pluginFuncs->size = sizeof(pluginFuncs);
94 pluginFuncs->newp = NPP_New;
95 pluginFuncs->destroy = NPP_Destroy;
96 pluginFuncs->setwindow = NPP_SetWindow;
97 pluginFuncs->newstream = NPP_NewStream;
98 pluginFuncs->destroystream = NPP_DestroyStream;
99 pluginFuncs->asfile = NPP_StreamAsFile;
100 pluginFuncs->writeready = NPP_WriteReady;
101 pluginFuncs->write = (NPP_WriteProcPtr)NPP_Write;
102 pluginFuncs->print = NPP_Print;
103 pluginFuncs->event = NPP_HandleEvent;
104 pluginFuncs->urlnotify = NPP_URLNotify;
105 pluginFuncs->getvalue = NPP_GetValue;
106 pluginFuncs->setvalue = NPP_SetValue;
107
108 static const struct {
109 NPNVariable v;
110 uint32_t size;
111 ANPInterface* i;
112 } gPairs[] = {
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400113 { kAudioTrackInterfaceV0_ANPGetValue, sizeof(gSoundI), &gSoundI },
Mike Reed224adad2009-06-10 10:24:01 -0400114 { kBitmapInterfaceV0_ANPGetValue, sizeof(gBitmapI), &gBitmapI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700115 { kCanvasInterfaceV0_ANPGetValue, sizeof(gCanvasI), &gCanvasI },
Mike Reed224adad2009-06-10 10:24:01 -0400116 { kLogInterfaceV0_ANPGetValue, sizeof(gLogI), &gLogI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700117 { kPaintInterfaceV0_ANPGetValue, sizeof(gPaintI), &gPaintI },
118 { kPathInterfaceV0_ANPGetValue, sizeof(gPathI), &gPathI },
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400119 { kSurfaceInterfaceV0_ANPGetValue, sizeof(gSurfaceI), &gSurfaceI },
Grace Kloba9ffe5ac2009-08-04 17:51:06 -0700120 { kSystemInterfaceV0_ANPGetValue, sizeof(gSystemI), &gSystemI },
121 { kTypefaceInterfaceV0_ANPGetValue, sizeof(gTypefaceI), &gTypefaceI },
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400122 { kWindowInterfaceV0_ANPGetValue, sizeof(gWindowI), &gWindowI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700123 };
124 for (size_t i = 0; i < ARRAY_COUNT(gPairs); i++) {
125 gPairs[i].i->inSize = gPairs[i].size;
126 NPError err = browser->getvalue(NULL, gPairs[i].v, gPairs[i].i);
127 if (err) {
128 return err;
129 }
130 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400131
Grace Klobafbe47c02009-05-14 17:31:45 -0700132 return NPERR_NO_ERROR;
133}
134
135void NP_Shutdown(void)
136{
137
138}
139
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400140const char *NP_GetMIMEDescription(void)
Grace Klobafbe47c02009-05-14 17:31:45 -0700141{
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400142 return "application/x-testbrowserplugin:tst:Test plugin mimetype is application/x-testbrowserplugin";
Grace Klobafbe47c02009-05-14 17:31:45 -0700143}
144
145NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
146 char* argn[], char* argv[], NPSavedData* saved)
147{
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400148
149 /* BEGIN: STANDARD PLUGIN FRAMEWORK */
Grace Klobafbe47c02009-05-14 17:31:45 -0700150 PluginObject *obj = NULL;
151
152 // Scripting functions appeared in NPAPI version 14
153 if (browser->version >= 14) {
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400154 instance->pdata = browser->createobject (instance, getPluginClass());
155 obj = static_cast<PluginObject*>(instance->pdata);
156 bzero(obj, sizeof(*obj));
Grace Klobafbe47c02009-05-14 17:31:45 -0700157 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400158 /* END: STANDARD PLUGIN FRAMEWORK */
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400159
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400160 // select the drawing model based on user input
161 ANPDrawingModel model = kBitmap_ANPDrawingModel;
162
163 for (int i = 0; i < argc; i++) {
164 if (!strcmp(argn[i], "DrawingModel")) {
165 if (!strcmp(argv[i], "Bitmap")) {
166 model = kBitmap_ANPDrawingModel;
167 }
168 else if (!strcmp(argv[i], "Surface")) {
169 model = kSurface_ANPDrawingModel;
170 }
171 gLogI.log(instance, kDebug_ANPLogType, "------ %p DrawingModel is %d", instance, model);
172 break;
173 }
174 }
175
176 // notify the plugin API of the drawing model we wish to use. This must be
177 // done prior to creating certain subPlugin objects (e.g. surfaceViews)
178 NPError err = browser->setvalue(instance, kRequestDrawingModel_ANPSetValue,
179 reinterpret_cast<void*>(model));
180 if (err) {
181 gLogI.log(instance, kError_ANPLogType, "request model %d err %d", model, err);
182 return err;
183 }
184
Grace Kloba9ffe5ac2009-08-04 17:51:06 -0700185 const char* path = gSystemI.getApplicationDataDirectory();
186 if (path) {
187 gLogI.log(instance, kDebug_ANPLogType, "Application data dir is %s", path);
188 } else {
189 gLogI.log(instance, kError_ANPLogType, "Can't find Application data dir");
190 }
191
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400192 // select the pluginType
193 for (int i = 0; i < argc; i++) {
194 if (!strcmp(argn[i], "PluginType")) {
195 if (!strcmp(argv[i], "Animation")) {
196 obj->pluginType = kAnimation_PluginType;
197 obj->activePlugin = new BallAnimation(instance);
198 }
199 else if (!strcmp(argv[i], "Audio")) {
200 obj->pluginType = kAudio_PluginType;
Derek Sollenbergerf42e2f42009-06-26 11:42:46 -0400201 obj->activePlugin = new AudioPlugin(instance);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400202 }
203 else if (!strcmp(argv[i], "Background")) {
204 obj->pluginType = kBackground_PluginType;
205 obj->activePlugin = new BackgroundPlugin(instance);
206 }
Derek Sollenbergerdb398a72009-06-29 13:53:04 -0400207 else if (!strcmp(argv[i], "Form")) {
208 obj->pluginType = kForm_PluginType;
209 obj->activePlugin = new FormPlugin(instance);
210 }
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400211 else if (!strcmp(argv[i], "Paint")) {
212 obj->pluginType = kPaint_PluginType;
213 obj->activePlugin = new PaintPlugin(instance);
214 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400215 gLogI.log(instance, kDebug_ANPLogType, "------ %p PluginType is %d", instance, obj->pluginType);
216 break;
217 }
218 }
219
220 // if no pluginType is specified then default to Animation
221 if (!obj->pluginType) {
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400222 gLogI.log(instance, kError_ANPLogType, "------ %p No PluginType attribute was found", instance);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400223 obj->pluginType = kAnimation_PluginType;
224 obj->activePlugin = new BallAnimation(instance);
225 }
226
Derek Sollenberger21f39912009-07-09 09:19:39 -0400227 // check to ensure the pluginType supports the model
228 if (!obj->activePlugin->supportsDrawingModel(model)) {
229 gLogI.log(instance, kError_ANPLogType, "------ %p Unsupported DrawingModel (%d)", instance, model);
230 return NPERR_GENERIC_ERROR;
231 }
232
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400233 return NPERR_NO_ERROR;
Grace Klobafbe47c02009-05-14 17:31:45 -0700234}
235
236NPError NPP_Destroy(NPP instance, NPSavedData** save)
237{
238 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400239 delete obj->activePlugin;
Grace Klobafbe47c02009-05-14 17:31:45 -0700240
241 return NPERR_NO_ERROR;
242}
243
Grace Klobafbe47c02009-05-14 17:31:45 -0700244NPError NPP_SetWindow(NPP instance, NPWindow* window)
245{
246 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400247
Grace Klobafbe47c02009-05-14 17:31:45 -0700248 // Do nothing if browser didn't support NPN_CreateObject which would have created the PluginObject.
249 if (obj != NULL) {
250 obj->window = window;
251 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400252
Grace Klobafbe47c02009-05-14 17:31:45 -0700253 browser->invalidaterect(instance, NULL);
254
255 return NPERR_NO_ERROR;
256}
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400257
Grace Klobafbe47c02009-05-14 17:31:45 -0700258NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
259{
260 *stype = NP_ASFILEONLY;
261 return NPERR_NO_ERROR;
262}
263
264NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
265{
266 return NPERR_NO_ERROR;
267}
268
269int32 NPP_WriteReady(NPP instance, NPStream* stream)
270{
271 return 0;
272}
273
274int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
275{
276 return 0;
277}
278
279void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
280{
281}
282
283void NPP_Print(NPP instance, NPPrint* platformPrint)
284{
Grace Klobafbe47c02009-05-14 17:31:45 -0700285}
286
Grace Klobafbe47c02009-05-14 17:31:45 -0700287int16 NPP_HandleEvent(NPP instance, void* event)
288{
289 PluginObject *obj = reinterpret_cast<PluginObject*>(instance->pdata);
290 const ANPEvent* evt = reinterpret_cast<const ANPEvent*>(event);
291
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400292#if DEBUG_PLUGIN_EVENTS
Grace Klobafbe47c02009-05-14 17:31:45 -0700293 switch (evt->eventType) {
294 case kDraw_ANPEventType:
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400295
296 if (evt->data.draw.model == kBitmap_ANPDrawingModel) {
297
298 static ANPBitmapFormat currentFormat = -1;
299 if (evt->data.draw.data.bitmap.format != currentFormat) {
300 currentFormat = evt->data.draw.data.bitmap.format;
301 gLogI.log(instance, kDebug_ANPLogType, "---- %p Draw (bitmap)"
302 " clip=%d,%d,%d,%d format=%d", instance,
303 evt->data.draw.clip.left,
304 evt->data.draw.clip.top,
305 evt->data.draw.clip.right,
306 evt->data.draw.clip.bottom,
307 evt->data.draw.data.bitmap.format);
308 }
Grace Klobafbe47c02009-05-14 17:31:45 -0700309 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400310 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700311
312 case kKey_ANPEventType:
313 gLogI.log(instance, kDebug_ANPLogType, "---- %p Key action=%d"
314 " code=%d vcode=%d unichar=%d repeat=%d mods=%x", instance,
315 evt->data.key.action,
316 evt->data.key.nativeCode,
317 evt->data.key.virtualCode,
318 evt->data.key.unichar,
319 evt->data.key.repeatCount,
320 evt->data.key.modifiers);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400321 break;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400322
323 case kLifecycle_ANPEventType:
324 gLogI.log(instance, kDebug_ANPLogType, "---- %p Lifecycle action=%d",
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400325 instance, evt->data.lifecycle.action);
Mike Reed1e7c3312009-05-26 16:37:45 -0400326 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700327
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400328 case kTouch_ANPEventType:
Grace Klobafbe47c02009-05-14 17:31:45 -0700329 gLogI.log(instance, kDebug_ANPLogType, "---- %p Touch action=%d [%d %d]",
330 instance, evt->data.touch.action, evt->data.touch.x,
331 evt->data.touch.y);
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400332 break;
333
Derek Sollenbergerdb398a72009-06-29 13:53:04 -0400334 case kMouse_ANPEventType:
335 gLogI.log(instance, kDebug_ANPLogType, "---- %p Mouse action=%d [%d %d]",
336 instance, evt->data.mouse.action, evt->data.mouse.x,
337 evt->data.mouse.y);
338 break;
339
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400340 case kVisibleRect_ANPEventType:
341 gLogI.log(instance, kDebug_ANPLogType, "---- %p VisibleRect [%d %d %d %d]",
Derek Sollenbergerf42e2f42009-06-26 11:42:46 -0400342 instance, evt->data.visibleRect.rect.left, evt->data.visibleRect.rect.top,
343 evt->data.visibleRect.rect.right, evt->data.visibleRect.rect.bottom);
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400344 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700345
346 default:
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400347 gLogI.log(instance, kError_ANPLogType, "---- %p Unknown Event [%d]",
348 instance, evt->eventType);
Grace Klobafbe47c02009-05-14 17:31:45 -0700349 break;
350 }
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400351#endif
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400352
353 if(!obj->activePlugin) {
354 gLogI.log(instance, kError_ANPLogType, "the active plugin is null.");
355 return 0; // unknown or unhandled event
356 }
357 else {
358 return obj->activePlugin->handleEvent(evt);
359 }
Grace Klobafbe47c02009-05-14 17:31:45 -0700360}
361
362void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
363{
364
365}
366
367EXPORT NPError NP_GetValue(NPP instance, NPPVariable variable, void *value) {
368
369 if (variable == NPPVpluginNameString) {
370 const char **str = (const char **)value;
371 *str = "Test Plugin";
372 return NPERR_NO_ERROR;
373 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400374
Grace Klobafbe47c02009-05-14 17:31:45 -0700375 if (variable == NPPVpluginDescriptionString) {
376 const char **str = (const char **)value;
377 *str = "Description of Test Plugin";
378 return NPERR_NO_ERROR;
379 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400380
Grace Klobafbe47c02009-05-14 17:31:45 -0700381 return NPERR_GENERIC_ERROR;
382}
383
384NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
385{
386 if (variable == NPPVpluginScriptableNPObject) {
387 void **v = (void **)value;
388 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400389
Grace Klobafbe47c02009-05-14 17:31:45 -0700390 if (obj)
391 browser->retainobject((NPObject*)obj);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400392
Grace Klobafbe47c02009-05-14 17:31:45 -0700393 *v = obj;
394 return NPERR_NO_ERROR;
395 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400396
Grace Klobafbe47c02009-05-14 17:31:45 -0700397 return NPERR_GENERIC_ERROR;
398}
399
400NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
401{
402 return NPERR_GENERIC_ERROR;
403}
404