blob: 119081c6b99f9278020cf13d09078a06da1105ee [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"
Derek Sollenbergerc0f26572009-07-16 11:38:02 -040036#include "SurfacePlugin.h"
Grace Klobafbe47c02009-05-14 17:31:45 -070037#include "android_npapi.h"
38
39NPNetscapeFuncs* browser;
40#define EXPORT __attribute__((visibility("default")))
41
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040042NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
Grace Klobafbe47c02009-05-14 17:31:45 -070043 char* argn[], char* argv[], NPSavedData* saved);
44NPError NPP_Destroy(NPP instance, NPSavedData** save);
45NPError NPP_SetWindow(NPP instance, NPWindow* window);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040046NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
Grace Klobafbe47c02009-05-14 17:31:45 -070047 NPBool seekable, uint16* stype);
48NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
49int32 NPP_WriteReady(NPP instance, NPStream* stream);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040050int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
Grace Klobafbe47c02009-05-14 17:31:45 -070051 void* buffer);
52void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
53void NPP_Print(NPP instance, NPPrint* platformPrint);
54int16 NPP_HandleEvent(NPP instance, void* event);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040055void NPP_URLNotify(NPP instance, const char* URL, NPReason reason,
Grace Klobafbe47c02009-05-14 17:31:45 -070056 void* notifyData);
57NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value);
58NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value);
59
60extern "C" {
61EXPORT NPError NP_Initialize(NPNetscapeFuncs* browserFuncs, NPPluginFuncs* pluginFuncs, void *java_env, void *application_context);
62EXPORT NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
63EXPORT const char* NP_GetMIMEDescription(void);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040064EXPORT void NP_Shutdown(void);
Grace Klobafbe47c02009-05-14 17:31:45 -070065};
66
67ANPAudioTrackInterfaceV0 gSoundI;
Mike Reed224adad2009-06-10 10:24:01 -040068ANPBitmapInterfaceV0 gBitmapI;
Grace Klobafbe47c02009-05-14 17:31:45 -070069ANPCanvasInterfaceV0 gCanvasI;
70ANPLogInterfaceV0 gLogI;
71ANPPaintInterfaceV0 gPaintI;
72ANPPathInterfaceV0 gPathI;
Derek Sollenbergerc0f26572009-07-16 11:38:02 -040073ANPSurfaceInterfaceV0 gSurfaceI;
Grace Kloba9ffe5ac2009-08-04 17:51:06 -070074ANPSystemInterfaceV0 gSystemI;
Grace Klobafbe47c02009-05-14 17:31:45 -070075ANPTypefaceInterfaceV0 gTypefaceI;
Derek Sollenberger5b011e32009-06-22 11:39:40 -040076ANPWindowInterfaceV0 gWindowI;
Grace Klobafbe47c02009-05-14 17:31:45 -070077
78#define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0]))
Derek Sollenberger5b011e32009-06-22 11:39:40 -040079#define DEBUG_PLUGIN_EVENTS 0
Grace Klobafbe47c02009-05-14 17:31:45 -070080
81NPError NP_Initialize(NPNetscapeFuncs* browserFuncs, NPPluginFuncs* pluginFuncs, void *java_env, void *application_context)
82{
83 // Make sure we have a function table equal or larger than we are built against.
84 if (browserFuncs->size < sizeof(NPNetscapeFuncs)) {
85 return NPERR_GENERIC_ERROR;
86 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040087
Grace Klobafbe47c02009-05-14 17:31:45 -070088 // Copy the function table (structure)
89 browser = (NPNetscapeFuncs*) malloc(sizeof(NPNetscapeFuncs));
90 memcpy(browser, browserFuncs, sizeof(NPNetscapeFuncs));
Derek Sollenberger9119e7d2009-06-08 10:53:09 -040091
Grace Klobafbe47c02009-05-14 17:31:45 -070092 // Build the plugin function table
93 pluginFuncs->version = 11;
94 pluginFuncs->size = sizeof(pluginFuncs);
95 pluginFuncs->newp = NPP_New;
96 pluginFuncs->destroy = NPP_Destroy;
97 pluginFuncs->setwindow = NPP_SetWindow;
98 pluginFuncs->newstream = NPP_NewStream;
99 pluginFuncs->destroystream = NPP_DestroyStream;
100 pluginFuncs->asfile = NPP_StreamAsFile;
101 pluginFuncs->writeready = NPP_WriteReady;
102 pluginFuncs->write = (NPP_WriteProcPtr)NPP_Write;
103 pluginFuncs->print = NPP_Print;
104 pluginFuncs->event = NPP_HandleEvent;
105 pluginFuncs->urlnotify = NPP_URLNotify;
106 pluginFuncs->getvalue = NPP_GetValue;
107 pluginFuncs->setvalue = NPP_SetValue;
108
109 static const struct {
110 NPNVariable v;
111 uint32_t size;
112 ANPInterface* i;
113 } gPairs[] = {
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400114 { kAudioTrackInterfaceV0_ANPGetValue, sizeof(gSoundI), &gSoundI },
Mike Reed224adad2009-06-10 10:24:01 -0400115 { kBitmapInterfaceV0_ANPGetValue, sizeof(gBitmapI), &gBitmapI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700116 { kCanvasInterfaceV0_ANPGetValue, sizeof(gCanvasI), &gCanvasI },
Mike Reed224adad2009-06-10 10:24:01 -0400117 { kLogInterfaceV0_ANPGetValue, sizeof(gLogI), &gLogI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700118 { kPaintInterfaceV0_ANPGetValue, sizeof(gPaintI), &gPaintI },
119 { kPathInterfaceV0_ANPGetValue, sizeof(gPathI), &gPathI },
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400120 { kSurfaceInterfaceV0_ANPGetValue, sizeof(gSurfaceI), &gSurfaceI },
Grace Kloba9ffe5ac2009-08-04 17:51:06 -0700121 { kSystemInterfaceV0_ANPGetValue, sizeof(gSystemI), &gSystemI },
122 { kTypefaceInterfaceV0_ANPGetValue, sizeof(gTypefaceI), &gTypefaceI },
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400123 { kWindowInterfaceV0_ANPGetValue, sizeof(gWindowI), &gWindowI },
Grace Klobafbe47c02009-05-14 17:31:45 -0700124 };
125 for (size_t i = 0; i < ARRAY_COUNT(gPairs); i++) {
126 gPairs[i].i->inSize = gPairs[i].size;
127 NPError err = browser->getvalue(NULL, gPairs[i].v, gPairs[i].i);
128 if (err) {
129 return err;
130 }
131 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400132
Grace Klobafbe47c02009-05-14 17:31:45 -0700133 return NPERR_NO_ERROR;
134}
135
136void NP_Shutdown(void)
137{
138
139}
140
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400141const char *NP_GetMIMEDescription(void)
Grace Klobafbe47c02009-05-14 17:31:45 -0700142{
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400143 return "application/x-testbrowserplugin:tst:Test plugin mimetype is application/x-testbrowserplugin";
Grace Klobafbe47c02009-05-14 17:31:45 -0700144}
145
146NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
147 char* argn[], char* argv[], NPSavedData* saved)
148{
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400149
150 /* BEGIN: STANDARD PLUGIN FRAMEWORK */
Grace Klobafbe47c02009-05-14 17:31:45 -0700151 PluginObject *obj = NULL;
152
153 // Scripting functions appeared in NPAPI version 14
154 if (browser->version >= 14) {
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400155 instance->pdata = browser->createobject (instance, getPluginClass());
156 obj = static_cast<PluginObject*>(instance->pdata);
157 bzero(obj, sizeof(*obj));
Grace Klobafbe47c02009-05-14 17:31:45 -0700158 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400159 /* END: STANDARD PLUGIN FRAMEWORK */
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400160
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400161 // select the drawing model based on user input
162 ANPDrawingModel model = kBitmap_ANPDrawingModel;
163
164 for (int i = 0; i < argc; i++) {
165 if (!strcmp(argn[i], "DrawingModel")) {
166 if (!strcmp(argv[i], "Bitmap")) {
167 model = kBitmap_ANPDrawingModel;
168 }
169 else if (!strcmp(argv[i], "Surface")) {
170 model = kSurface_ANPDrawingModel;
171 }
172 gLogI.log(instance, kDebug_ANPLogType, "------ %p DrawingModel is %d", instance, model);
173 break;
174 }
175 }
176
177 // notify the plugin API of the drawing model we wish to use. This must be
178 // done prior to creating certain subPlugin objects (e.g. surfaceViews)
179 NPError err = browser->setvalue(instance, kRequestDrawingModel_ANPSetValue,
180 reinterpret_cast<void*>(model));
181 if (err) {
182 gLogI.log(instance, kError_ANPLogType, "request model %d err %d", model, err);
183 return err;
184 }
185
Grace Kloba9ffe5ac2009-08-04 17:51:06 -0700186 const char* path = gSystemI.getApplicationDataDirectory();
187 if (path) {
188 gLogI.log(instance, kDebug_ANPLogType, "Application data dir is %s", path);
189 } else {
190 gLogI.log(instance, kError_ANPLogType, "Can't find Application data dir");
191 }
192
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400193 // select the pluginType
194 for (int i = 0; i < argc; i++) {
195 if (!strcmp(argn[i], "PluginType")) {
196 if (!strcmp(argv[i], "Animation")) {
197 obj->pluginType = kAnimation_PluginType;
198 obj->activePlugin = new BallAnimation(instance);
199 }
200 else if (!strcmp(argv[i], "Audio")) {
201 obj->pluginType = kAudio_PluginType;
Derek Sollenbergerf42e2f42009-06-26 11:42:46 -0400202 obj->activePlugin = new AudioPlugin(instance);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400203 }
204 else if (!strcmp(argv[i], "Background")) {
205 obj->pluginType = kBackground_PluginType;
206 obj->activePlugin = new BackgroundPlugin(instance);
207 }
Derek Sollenbergerdb398a72009-06-29 13:53:04 -0400208 else if (!strcmp(argv[i], "Form")) {
209 obj->pluginType = kForm_PluginType;
210 obj->activePlugin = new FormPlugin(instance);
211 }
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400212 else if (!strcmp(argv[i], "Paint")) {
213 obj->pluginType = kPaint_PluginType;
214 obj->activePlugin = new PaintPlugin(instance);
215 }
Derek Sollenbergerc0f26572009-07-16 11:38:02 -0400216 else if (!strcmp(argv[i], "RGBA_Surface")) {
217 obj->pluginType = kSurface_PluginType;
218 obj->activePlugin = new SurfacePlugin(instance, kRGBA_ANPSurfaceType);
219 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400220 gLogI.log(instance, kDebug_ANPLogType, "------ %p PluginType is %d", instance, obj->pluginType);
221 break;
222 }
223 }
224
225 // if no pluginType is specified then default to Animation
226 if (!obj->pluginType) {
Derek Sollenberger4fb83e62009-07-27 16:40:13 -0400227 gLogI.log(instance, kError_ANPLogType, "------ %p No PluginType attribute was found", instance);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400228 obj->pluginType = kAnimation_PluginType;
229 obj->activePlugin = new BallAnimation(instance);
230 }
231
Derek Sollenberger21f39912009-07-09 09:19:39 -0400232 // check to ensure the pluginType supports the model
233 if (!obj->activePlugin->supportsDrawingModel(model)) {
234 gLogI.log(instance, kError_ANPLogType, "------ %p Unsupported DrawingModel (%d)", instance, model);
235 return NPERR_GENERIC_ERROR;
236 }
237
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400238 return NPERR_NO_ERROR;
Grace Klobafbe47c02009-05-14 17:31:45 -0700239}
240
241NPError NPP_Destroy(NPP instance, NPSavedData** save)
242{
243 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400244 delete obj->activePlugin;
Grace Klobafbe47c02009-05-14 17:31:45 -0700245
246 return NPERR_NO_ERROR;
247}
248
Grace Klobafbe47c02009-05-14 17:31:45 -0700249NPError NPP_SetWindow(NPP instance, NPWindow* window)
250{
251 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400252
Grace Klobafbe47c02009-05-14 17:31:45 -0700253 // Do nothing if browser didn't support NPN_CreateObject which would have created the PluginObject.
254 if (obj != NULL) {
255 obj->window = window;
256 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400257
Grace Klobafbe47c02009-05-14 17:31:45 -0700258 browser->invalidaterect(instance, NULL);
259
260 return NPERR_NO_ERROR;
261}
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400262
Grace Klobafbe47c02009-05-14 17:31:45 -0700263NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
264{
265 *stype = NP_ASFILEONLY;
266 return NPERR_NO_ERROR;
267}
268
269NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
270{
271 return NPERR_NO_ERROR;
272}
273
274int32 NPP_WriteReady(NPP instance, NPStream* stream)
275{
276 return 0;
277}
278
279int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
280{
281 return 0;
282}
283
284void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
285{
286}
287
288void NPP_Print(NPP instance, NPPrint* platformPrint)
289{
Grace Klobafbe47c02009-05-14 17:31:45 -0700290}
291
Grace Klobafbe47c02009-05-14 17:31:45 -0700292int16 NPP_HandleEvent(NPP instance, void* event)
293{
294 PluginObject *obj = reinterpret_cast<PluginObject*>(instance->pdata);
295 const ANPEvent* evt = reinterpret_cast<const ANPEvent*>(event);
296
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400297#if DEBUG_PLUGIN_EVENTS
Grace Klobafbe47c02009-05-14 17:31:45 -0700298 switch (evt->eventType) {
299 case kDraw_ANPEventType:
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400300
301 if (evt->data.draw.model == kBitmap_ANPDrawingModel) {
302
303 static ANPBitmapFormat currentFormat = -1;
304 if (evt->data.draw.data.bitmap.format != currentFormat) {
305 currentFormat = evt->data.draw.data.bitmap.format;
306 gLogI.log(instance, kDebug_ANPLogType, "---- %p Draw (bitmap)"
307 " clip=%d,%d,%d,%d format=%d", instance,
308 evt->data.draw.clip.left,
309 evt->data.draw.clip.top,
310 evt->data.draw.clip.right,
311 evt->data.draw.clip.bottom,
312 evt->data.draw.data.bitmap.format);
313 }
Grace Klobafbe47c02009-05-14 17:31:45 -0700314 }
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400315 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700316
317 case kKey_ANPEventType:
318 gLogI.log(instance, kDebug_ANPLogType, "---- %p Key action=%d"
319 " code=%d vcode=%d unichar=%d repeat=%d mods=%x", instance,
320 evt->data.key.action,
321 evt->data.key.nativeCode,
322 evt->data.key.virtualCode,
323 evt->data.key.unichar,
324 evt->data.key.repeatCount,
325 evt->data.key.modifiers);
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400326 break;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400327
328 case kLifecycle_ANPEventType:
329 gLogI.log(instance, kDebug_ANPLogType, "---- %p Lifecycle action=%d",
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400330 instance, evt->data.lifecycle.action);
Mike Reed1e7c3312009-05-26 16:37:45 -0400331 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700332
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400333 case kTouch_ANPEventType:
Grace Klobafbe47c02009-05-14 17:31:45 -0700334 gLogI.log(instance, kDebug_ANPLogType, "---- %p Touch action=%d [%d %d]",
335 instance, evt->data.touch.action, evt->data.touch.x,
336 evt->data.touch.y);
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400337 break;
338
Derek Sollenbergerdb398a72009-06-29 13:53:04 -0400339 case kMouse_ANPEventType:
340 gLogI.log(instance, kDebug_ANPLogType, "---- %p Mouse action=%d [%d %d]",
341 instance, evt->data.mouse.action, evt->data.mouse.x,
342 evt->data.mouse.y);
343 break;
344
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400345 case kVisibleRect_ANPEventType:
346 gLogI.log(instance, kDebug_ANPLogType, "---- %p VisibleRect [%d %d %d %d]",
Derek Sollenbergerf42e2f42009-06-26 11:42:46 -0400347 instance, evt->data.visibleRect.rect.left, evt->data.visibleRect.rect.top,
348 evt->data.visibleRect.rect.right, evt->data.visibleRect.rect.bottom);
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400349 break;
Grace Klobafbe47c02009-05-14 17:31:45 -0700350
351 default:
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400352 gLogI.log(instance, kError_ANPLogType, "---- %p Unknown Event [%d]",
353 instance, evt->eventType);
Grace Klobafbe47c02009-05-14 17:31:45 -0700354 break;
355 }
Derek Sollenberger5b011e32009-06-22 11:39:40 -0400356#endif
Derek Sollenbergerd7ebf272009-06-18 11:19:41 -0400357
358 if(!obj->activePlugin) {
359 gLogI.log(instance, kError_ANPLogType, "the active plugin is null.");
360 return 0; // unknown or unhandled event
361 }
362 else {
363 return obj->activePlugin->handleEvent(evt);
364 }
Grace Klobafbe47c02009-05-14 17:31:45 -0700365}
366
367void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
368{
369
370}
371
372EXPORT NPError NP_GetValue(NPP instance, NPPVariable variable, void *value) {
373
374 if (variable == NPPVpluginNameString) {
375 const char **str = (const char **)value;
376 *str = "Test Plugin";
377 return NPERR_NO_ERROR;
378 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400379
Grace Klobafbe47c02009-05-14 17:31:45 -0700380 if (variable == NPPVpluginDescriptionString) {
381 const char **str = (const char **)value;
382 *str = "Description of Test Plugin";
383 return NPERR_NO_ERROR;
384 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400385
Grace Klobafbe47c02009-05-14 17:31:45 -0700386 return NPERR_GENERIC_ERROR;
387}
388
389NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
390{
391 if (variable == NPPVpluginScriptableNPObject) {
392 void **v = (void **)value;
393 PluginObject *obj = (PluginObject*) instance->pdata;
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400394
Grace Klobafbe47c02009-05-14 17:31:45 -0700395 if (obj)
396 browser->retainobject((NPObject*)obj);
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400397
Grace Klobafbe47c02009-05-14 17:31:45 -0700398 *v = obj;
399 return NPERR_NO_ERROR;
400 }
Derek Sollenberger9119e7d2009-06-08 10:53:09 -0400401
Grace Klobafbe47c02009-05-14 17:31:45 -0700402 return NPERR_GENERIC_ERROR;
403}
404
405NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
406{
407 return NPERR_GENERIC_ERROR;
408}
409