/***************************************************************************** FILE: nptango.c, TomaszMajor-14May98, mc-v0.00-20Feb97 PURPOSE: Tango plugin for Netscape *****************************************************************************/ #include #include #include "npapi.h" /*Define IMPLEMENT_* before including *.h to state that we're implementing the native methods of this plug-in here, and consequently need to access it's protected and private members.*/ #include "webwisdom_tango_structures_LocalBase.h" #define CL "nptango.c: " #define CL2 "TANGO plugin: " /*We'll keep a global execution environment around to make our life simpler.*/ JRIEnv* JRIENV_env; /*Tango variables*/ char *serverHost; char *serverPort; char *localPort; char *rootDir; #ifdef XP_UNIX #define PLUGIN_MIME "application/x-collaboratory" #define PLUGIN_SUFFIXES "*" #define PLUGIN_NAME "Tango v.1.0" #define PLUGIN_TITLE "TANGO Interactive" #define PLUGIN_DESCRIPTION "
Collaboratory system for the Web created at NPAC, Syracuse University.
Tango is used in education & distance learning, command & control,
health care, computer steering, and entertainment.
Start TANGO
" char* NPP_GetMIMEDescription(void) { return(PLUGIN_MIME":"PLUGIN_SUFFIXES":"PLUGIN_NAME); }/* NPP_GetMIMEDescription ************************************************/ NPError NPP_GetValue(void *future,NPPVariable variable,void *value) { NPError err=NPERR_NO_ERROR; if(variable==NPPVpluginNameString) *((char **)value)=PLUGIN_TITLE; else if(variable==NPPVpluginDescriptionString) *((char **)value)=PLUGIN_DESCRIPTION; else err=NPERR_GENERIC_ERROR; return err; }/* NPP_GetValue **********************************************************/ #endif /*XP_UNIX*/ /**************************************************************************** NPP_Initialize is called when your DLL is being loaded to do any DLL-specific initialization. ****************************************************************************/ NPError NPP_Initialize(void) { return NPERR_NO_ERROR; }/* NPP_Initialize *********************************************************/ /*************************************************************************** NPP_GetJavaClass is called during initialization to ask your plugin what its associated Java class is. If you don't have one, just return NULL. Otherwise, use the javah-generated "use_" function to both initialize your class and return it. If you can't find your class, an error will be signalled by "use_" and will cause the Navigator to complain to the user. ***************************************************************************/ jref NPP_GetJavaClass() { struct java_lang_Class *lb_class; JRIENV_env=NPN_GetJavaEnv(); if(JRIENV_env==NULL) { fprintf(stderr,CL"Java disabled!\n"); return NULL; } lb_class=use_webwisdom_tango_structures_LocalBase(JRIENV_env); if(lb_class==NULL) { fprintf(stderr,CL"webwisdom.tango.structures.LocalBase.class not installed!\n"); return NULL; } return lb_class; }/* NPP_GetJavaClass ******************************************************/ /*************************************************************************** NPP_Shutdown is called when your DLL is being unloaded to do any DLL-specific shut-down. You should be a good citizen and declare that you're not using your java class any more. This allows java to unload it, freeing up memory. ***************************************************************************/ void NPP_Shutdown(void) { if(JRIENV_env) unuse_webwisdom_tango_structures_LocalBase(JRIENV_env); }/* NPP_Shutdown **********************************************************/ /*************************************************************************** NPP_New is called when your plugin is instantiated (i.e. when an EMBED tag appears on a page). ***************************************************************************/ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) { NPError result=NPERR_NO_ERROR; int i; serverHost=NULL; serverPort=NULL; localPort=NULL; for(i=0;i