1 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
5 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
11 #include <CodeFragments.h>
13 #include <Resources.h>
14 #include <ToolUtils.h>
19 // A4Stuff.h contains the definition of EnterCodeResource and
20 // EnterCodeResource, used for setting up the code resourceÕs
21 // globals for 68K (analagous to the function SetCurrentA5
22 // defined by the toolbox).
24 // A4Stuff does not exist as of CW 7. Define them to nothing.
27 #if (defined(__MWERKS__) && (__MWERKS__ >= 0x2400)) || defined(__GNUC__)
28 #define EnterCodeResource()
29 #define ExitCodeResource()
37 // The Mixed Mode procInfos defined in npupp.h assume Think C-
38 // style calling conventions. These conventions are used by
39 // Metrowerks with the exception of pointer return types, which
40 // in Metrowerks 68K are returned in A0, instead of the standard
41 // D0. Thus, since NPN_MemAlloc and NPN_UserAgent return pointers,
42 // Mixed Mode will return the values to a 68K plugin in D0, but
43 // a 68K plugin compiled by Metrowerks will expect the result in
44 // A0. The following pragma forces Metrowerks to use D0 instead.
48 #pragma pointers_in_D0
56 #pragma pointers_in_A0
60 // The following fix for static initializers (which fixes a previous
61 // incompatibility with some parts of PowerPlant, was submitted by
68 extern void __InitCode__(void);
70 extern void __sinit(void);
71 #define __InitCode__ __sinit
73 extern void __destroy_global_chain(void);
80 // Define PLUGIN_TRACE to 1 to have the wrapper functions emit
81 // DebugStr messages whenever they are called.
83 //#define PLUGIN_TRACE 1
86 #define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
88 #define PLUGINDEBUGSTR
94 // glue for mapping outgoing Macho function pointers to TVectors
102 TFPtoTVGlue setwindow;
103 TFPtoTVGlue newstream;
104 TFPtoTVGlue destroystream;
106 TFPtoTVGlue writeready;
110 TFPtoTVGlue urlnotify;
111 TFPtoTVGlue getvalue;
112 TFPtoTVGlue setvalue;
114 TFPtoTVGlue shutdown;
115 } gPluginFuncsGlueTable;
117 static inline void* SetupFPtoTVGlue(TFPtoTVGlue* functionGlue, void* fp)
119 functionGlue->glue[0] = fp;
120 functionGlue->glue[1] = 0;
124 #define PLUGIN_TO_HOST_GLUE(name, fp) (SetupFPtoTVGlue(&gPluginFuncsGlueTable.name, (void*)fp))
126 // glue for mapping netscape TVectors to Macho function pointers
134 TTVtoFPGlue requestread;
135 TTVtoFPGlue newstream;
137 TTVtoFPGlue destroystream;
140 TTVtoFPGlue memalloc;
142 TTVtoFPGlue memflush;
143 TTVtoFPGlue reloadplugins;
144 TTVtoFPGlue getJavaEnv;
145 TTVtoFPGlue getJavaPeer;
146 TTVtoFPGlue geturlnotify;
147 TTVtoFPGlue posturlnotify;
148 TTVtoFPGlue getvalue;
149 TTVtoFPGlue setvalue;
150 TTVtoFPGlue invalidaterect;
151 TTVtoFPGlue invalidateregion;
152 TTVtoFPGlue forceredraw;
153 } gNetscapeFuncsGlueTable;
155 static void* SetupTVtoFPGlue(TTVtoFPGlue* functionGlue, void* tvp)
157 static const TTVtoFPGlue glueTemplate = { 0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420 };
159 memcpy(functionGlue, &glueTemplate, sizeof(TTVtoFPGlue));
160 functionGlue->glue[0] |= ((UInt32)tvp >> 16);
161 functionGlue->glue[1] |= ((UInt32)tvp & 0xFFFF);
162 ::MakeDataExecutable(functionGlue, sizeof(TTVtoFPGlue));
166 #define HOST_TO_PLUGIN_GLUE(name, fp) (SetupTVtoFPGlue(&gNetscapeFuncsGlueTable.name, (void*)fp))
170 #define PLUGIN_TO_HOST_GLUE(name, fp) (fp)
171 #define HOST_TO_PLUGIN_GLUE(name, fp) (fp)
173 #endif /* XP_MACOSX */
179 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
183 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
185 #if !TARGET_API_MAC_CARBON
186 QDGlobals* gQDPtr; // Pointer to NetscapeÕs QuickDraw globals
188 short gResFile; // Refnum of the pluginÕs resource file
189 NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin
191 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
193 // Wrapper functions for all calls from the plugin to Netscape.
194 // These functions let the plugin developer just call the APIs
195 // as documented and defined in npapi.h, without needing to know
196 // about the function table and call macros in npupp.h.
198 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
201 void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
203 *plugin_major = NP_VERSION_MAJOR;
204 *plugin_minor = NP_VERSION_MINOR;
205 *netscape_major = gNetscapeFuncs.version >> 8; // Major version is in high byte
206 *netscape_minor = gNetscapeFuncs.version & 0xFF; // Minor version is in low byte
209 NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
211 int navMinorVers = gNetscapeFuncs.version & 0xFF;
214 if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
216 err = CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
220 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
225 NPError NPN_GetURL(NPP instance, const char* url, const char* window)
227 return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
230 NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
232 int navMinorVers = gNetscapeFuncs.version & 0xFF;
235 if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
237 err = CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, instance, url,
238 window, len, buf, file, notifyData);
242 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
247 NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
249 return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, url, window, len, buf, file);
252 NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
254 return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, stream, rangeList);
257 NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* window, NPStream** stream)
259 int navMinorVers = gNetscapeFuncs.version & 0xFF;
262 if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
264 err = CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, type, window, stream);
268 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
273 int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
275 int navMinorVers = gNetscapeFuncs.version & 0xFF;
278 if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
280 err = CallNPN_WriteProc(gNetscapeFuncs.write, instance, stream, len, buffer);
284 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
289 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
291 int navMinorVers = gNetscapeFuncs.version & 0xFF;
294 if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
296 err = CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, instance, stream, reason);
300 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
305 void NPN_Status(NPP instance, const char* message)
307 CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
310 const char* NPN_UserAgent(NPP instance)
312 return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
315 void* NPN_MemAlloc(uint32 size)
317 return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
320 void NPN_MemFree(void* ptr)
322 CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
325 uint32 NPN_MemFlush(uint32 size)
327 return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
330 void NPN_ReloadPlugins(NPBool reloadPages)
332 CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
336 JRIEnv* NPN_GetJavaEnv(void)
338 return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv );
341 jobject NPN_GetJavaPeer(NPP instance)
343 return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance );
347 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
349 return CallNPN_GetValueProc( gNetscapeFuncs.getvalue, instance, variable, value);
352 NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
354 return CallNPN_SetValueProc( gNetscapeFuncs.setvalue, instance, variable, value);
357 void NPN_InvalidateRect(NPP instance, NPRect *rect)
359 CallNPN_InvalidateRectProc( gNetscapeFuncs.invalidaterect, instance, rect);
362 void NPN_InvalidateRegion(NPP instance, NPRegion region)
364 CallNPN_InvalidateRegionProc( gNetscapeFuncs.invalidateregion, instance, region);
367 void NPN_ForceRedraw(NPP instance)
369 CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance);
374 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
376 // Wrapper functions for all calls from Netscape to the plugin.
377 // These functions let the plugin developer just create the APIs
378 // as documented and defined in npapi.h, without needing to
379 // install those functions in the function table or worry about
380 // setting up globals for 68K plugins.
382 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
384 NPError Private_Initialize(void);
385 void Private_Shutdown(void);
386 NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
387 NPError Private_Destroy(NPP instance, NPSavedData** save);
388 NPError Private_SetWindow(NPP instance, NPWindow* window);
389 NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
390 NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
391 int32 Private_WriteReady(NPP instance, NPStream* stream);
392 int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
393 void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
394 void Private_Print(NPP instance, NPPrint* platformPrint);
395 int16 Private_HandleEvent(NPP instance, void* event);
396 void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
397 jobject Private_GetJavaClass(void);
400 NPError Private_Initialize(void)
404 PLUGINDEBUGSTR("\pInitialize;g;");
405 err = NPP_Initialize();
410 void Private_Shutdown(void)
413 PLUGINDEBUGSTR("\pShutdown;g;");
417 __destroy_global_chain();
424 NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
427 NPError ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
428 PLUGINDEBUGSTR("\pNew;g;");
433 NPError Private_Destroy(NPP instance, NPSavedData** save)
437 PLUGINDEBUGSTR("\pDestroy;g;");
438 err = NPP_Destroy(instance, save);
443 NPError Private_SetWindow(NPP instance, NPWindow* window)
447 PLUGINDEBUGSTR("\pSetWindow;g;");
448 err = NPP_SetWindow(instance, window);
453 NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
457 PLUGINDEBUGSTR("\pNewStream;g;");
458 err = NPP_NewStream(instance, type, stream, seekable, stype);
463 int32 Private_WriteReady(NPP instance, NPStream* stream)
467 PLUGINDEBUGSTR("\pWriteReady;g;");
468 result = NPP_WriteReady(instance, stream);
473 int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
477 PLUGINDEBUGSTR("\pWrite;g;");
478 result = NPP_Write(instance, stream, offset, len, buffer);
483 void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
486 PLUGINDEBUGSTR("\pStreamAsFile;g;");
487 NPP_StreamAsFile(instance, stream, fname);
492 NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
496 PLUGINDEBUGSTR("\pDestroyStream;g;");
497 err = NPP_DestroyStream(instance, stream, reason);
502 int16 Private_HandleEvent(NPP instance, void* event)
506 PLUGINDEBUGSTR("\pHandleEvent;g;");
507 result = NPP_HandleEvent(instance, event);
512 void Private_Print(NPP instance, NPPrint* platformPrint)
515 PLUGINDEBUGSTR("\pPrint;g;");
516 NPP_Print(instance, platformPrint);
520 void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
523 PLUGINDEBUGSTR("\pURLNotify;g;");
524 NPP_URLNotify(instance, url, reason, notifyData);
529 jobject Private_GetJavaClass(void)
532 PLUGINDEBUGSTR("\pGetJavaClass;g;");
534 jobject clazz = NPP_GetJavaClass();
538 JRIEnv* env = NPN_GetJavaEnv();
539 return (jobject)JRI_NewGlobalRef(env, clazz);
548 #if !TARGET_API_MAC_CARBON
549 ProcessSerialNumber PSN;
552 ProcessInfoRec infoRec;
553 OSErr result = noErr;
554 CFragConnectionID connID;
559 // Memorize the pluginÕs resource file
560 // refnum for later use.
562 gResFile = CurResFile();
564 #if !TARGET_API_MAC_CARBON
566 // Ask the system if CFM is available.
569 OSErr err = Gestalt(gestaltCFMAttr, &response);
570 Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
572 ProcessInfoRec infoRec;
576 // GetProcessInformation takes a process serial number and
577 // will give us back the name and FSSpec of the application.
578 // See the Process Manager in IM.
582 infoRec.processInfoLength = sizeof(ProcessInfoRec);
583 infoRec.processName = name;
584 infoRec.processAppSpec = &myFSSpec;
586 ProcessSerialNumber PSN;
587 PSN.highLongOfPSN = 0;
588 PSN.lowLongOfPSN = kCurrentProcess;
590 result = GetProcessInformation(&PSN, &infoRec);
592 PLUGINDEBUGSTR("\pFailed in GetProcessInformation");
596 // If no CFM installed, assume it must be a 68K app.
600 CFragConnectionID connID;
604 // Now that we know the app name and FSSpec, we can call GetDiskFragment
605 // to get a connID to use in a subsequent call to FindSymbol (it will also
606 // return the address of ÒmainÓ in app, which we ignore). If GetDiskFragment
607 // returns an error, we assume the app must be 68K.
611 result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName,
612 kLoadCFrag, &connID, (Ptr*)&mainAddr, errName);
618 // The app is a PPC code fragment, so call FindSymbol
619 // to get the exported ÒqdÓ symbol so we can access its
620 // QuickDraw globals.
622 CFragSymbolClass symClass;
623 result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
624 if (result != noErr) { // this fails if we are in NS 6
625 gQDPtr = &qd; // so we default to the standard QD globals
631 // The app is 68K, so use its A5 to compute the address
632 // of its QuickDraw globals.
634 gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr)));
641 // gcc requires that main have an 'int' return type
642 int main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
644 NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
647 #if !TARGET_API_MAC_CARBON
650 RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main);
653 #endif /* !TARGET_API_MAC_CARBON */
656 DEFINE_API_C(int) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
658 DEFINE_API_C(NPError) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
662 PLUGINDEBUGSTR("\pmain");
668 NPError err = NPERR_NO_ERROR;
671 // Ensure that everything Netscape passed us is valid!
673 if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == NULL))
674 err = NPERR_INVALID_FUNCTABLE_ERROR;
677 // Check the ÒmajorÓ version passed in NetscapeÕs function table.
678 // We wonÕt load if the major version is newer than what we expect.
679 // Also check that the function tables passed in are big enough for
680 // all the functions we need (they could be bigger, if Netscape added
681 // new APIs, but thatÕs OK with us -- weÕll just ignore them).
683 if (err == NPERR_NO_ERROR)
685 if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte
686 err = NPERR_INCOMPATIBLE_VERSION_ERROR;
690 if (err == NPERR_NO_ERROR)
693 // Copy all the fields of NetscapeÕs function table into our
694 // copy so we can call back into Netscape later. Note that
695 // we need to copy the fields one by one, rather than assigning
696 // the whole structure, because the Netscape function table
697 // could actually be bigger than what we expect.
700 int navMinorVers = nsTable->version & 0xFF;
702 gNetscapeFuncs.version = nsTable->version;
703 gNetscapeFuncs.size = nsTable->size;
704 gNetscapeFuncs.posturl = (NPN_PostURLUPP)HOST_TO_PLUGIN_GLUE(posturl, nsTable->posturl);
705 gNetscapeFuncs.geturl = (NPN_GetURLUPP)HOST_TO_PLUGIN_GLUE(geturl, nsTable->geturl);
706 gNetscapeFuncs.requestread = (NPN_RequestReadUPP)HOST_TO_PLUGIN_GLUE(requestread, nsTable->requestread);
707 gNetscapeFuncs.newstream = (NPN_NewStreamUPP)HOST_TO_PLUGIN_GLUE(newstream, nsTable->newstream);
708 gNetscapeFuncs.write = (NPN_WriteUPP)HOST_TO_PLUGIN_GLUE(write, nsTable->write);
709 gNetscapeFuncs.destroystream = (NPN_DestroyStreamUPP)HOST_TO_PLUGIN_GLUE(destroystream, nsTable->destroystream);
710 gNetscapeFuncs.status = (NPN_StatusUPP)HOST_TO_PLUGIN_GLUE(status, nsTable->status);
711 gNetscapeFuncs.uagent = (NPN_UserAgentUPP)HOST_TO_PLUGIN_GLUE(uagent, nsTable->uagent);
712 gNetscapeFuncs.memalloc = (NPN_MemAllocUPP)HOST_TO_PLUGIN_GLUE(memalloc, nsTable->memalloc);
713 gNetscapeFuncs.memfree = (NPN_MemFreeUPP)HOST_TO_PLUGIN_GLUE(memfree, nsTable->memfree);
714 gNetscapeFuncs.memflush = (NPN_MemFlushUPP)HOST_TO_PLUGIN_GLUE(memflush, nsTable->memflush);
715 gNetscapeFuncs.reloadplugins = (NPN_ReloadPluginsUPP)HOST_TO_PLUGIN_GLUE(reloadplugins, nsTable->reloadplugins);
716 if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
718 gNetscapeFuncs.getJavaEnv = (NPN_GetJavaEnvUPP)HOST_TO_PLUGIN_GLUE(getJavaEnv, nsTable->getJavaEnv);
719 gNetscapeFuncs.getJavaPeer = (NPN_GetJavaPeerUPP)HOST_TO_PLUGIN_GLUE(getJavaPeer, nsTable->getJavaPeer);
721 if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
723 gNetscapeFuncs.geturlnotify = (NPN_GetURLNotifyUPP)HOST_TO_PLUGIN_GLUE(geturlnotify, nsTable->geturlnotify);
724 gNetscapeFuncs.posturlnotify = (NPN_PostURLNotifyUPP)HOST_TO_PLUGIN_GLUE(posturlnotify, nsTable->posturlnotify);
726 gNetscapeFuncs.getvalue = (NPN_GetValueUPP)HOST_TO_PLUGIN_GLUE(getvalue, nsTable->getvalue);
727 gNetscapeFuncs.setvalue = (NPN_SetValueUPP)HOST_TO_PLUGIN_GLUE(setvalue, nsTable->setvalue);
728 gNetscapeFuncs.invalidaterect = (NPN_InvalidateRectUPP)HOST_TO_PLUGIN_GLUE(invalidaterect, nsTable->invalidaterect);
729 gNetscapeFuncs.invalidateregion = (NPN_InvalidateRegionUPP)HOST_TO_PLUGIN_GLUE(invalidateregion, nsTable->invalidateregion);
730 gNetscapeFuncs.forceredraw = (NPN_ForceRedrawUPP)HOST_TO_PLUGIN_GLUE(forceredraw, nsTable->forceredraw);
733 // Set up the plugin function table that Netscape will use to
734 // call us. Netscape needs to know about our version and size
735 // and have a UniversalProcPointer for every function we implement.
737 pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
738 pluginFuncs->size = sizeof(NPPluginFuncs);
739 pluginFuncs->newp = NewNPP_NewProc(PLUGIN_TO_HOST_GLUE(newp, Private_New));
740 pluginFuncs->destroy = NewNPP_DestroyProc(PLUGIN_TO_HOST_GLUE(destroy, Private_Destroy));
741 pluginFuncs->setwindow = NewNPP_SetWindowProc(PLUGIN_TO_HOST_GLUE(setwindow, Private_SetWindow));
742 pluginFuncs->newstream = NewNPP_NewStreamProc(PLUGIN_TO_HOST_GLUE(newstream, Private_NewStream));
743 pluginFuncs->destroystream = NewNPP_DestroyStreamProc(PLUGIN_TO_HOST_GLUE(destroystream, Private_DestroyStream));
744 pluginFuncs->asfile = NewNPP_StreamAsFileProc(PLUGIN_TO_HOST_GLUE(asfile, Private_StreamAsFile));
745 pluginFuncs->writeready = NewNPP_WriteReadyProc(PLUGIN_TO_HOST_GLUE(writeready, Private_WriteReady));
746 pluginFuncs->write = NewNPP_WriteProc(PLUGIN_TO_HOST_GLUE(write, Private_Write));
747 pluginFuncs->print = NewNPP_PrintProc(PLUGIN_TO_HOST_GLUE(print, Private_Print));
748 pluginFuncs->event = NewNPP_HandleEventProc(PLUGIN_TO_HOST_GLUE(event, Private_HandleEvent));
749 if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
751 pluginFuncs->urlnotify = NewNPP_URLNotifyProc(PLUGIN_TO_HOST_GLUE(urlnotify, Private_URLNotify));
754 if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
756 pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass();
759 pluginFuncs->javaClass = NULL;
761 *unloadUpp = NewNPP_ShutdownProc(PLUGIN_TO_HOST_GLUE(shutdown, Private_Shutdown));
764 err = Private_Initialize();