Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
npwin.cpp File Reference
#include "npapi.h"
#include "npupp.h"

Go to the source code of this file.

Defines

#define NP_EXPORT   _export

Functions

JRIGlobalRef Private_GetJavaClass (void)
NPError WINAPI NP_EXPORT NP_GetEntryPoints (NPPluginFuncs *pFuncs)
NPError WINAPI NP_EXPORT NP_Initialize (NPNetscapeFuncs *pFuncs)
return NPP_Initialize ()
NPError WINAPI NP_EXPORT NP_Shutdown ()
void NPN_Version (int *plugin_major, int *plugin_minor, int *netscape_major, int *netscape_minor)
NPError NPN_GetURLNotify (NPP instance, const char *url, const char *target, void *notifyData)
NPError NPN_GetURL (NPP instance, const char *url, const char *target)
NPError NPN_PostURLNotify (NPP instance, const char *url, const char *window, uint32 len, const char *buf, NPBool file, void *notifyData)
NPError NPN_PostURL (NPP instance, const char *url, const char *window, uint32 len, const char *buf, NPBool file)
NPError NPN_RequestRead (NPStream *stream, NPByteRange *rangeList)
NPError NPN_NewStream (NPP instance, NPMIMEType type, const char *target, NPStream **stream)
int32 NPN_Write (NPP instance, NPStream *stream, int32 len, void *buffer)
NPError NPN_DestroyStream (NPP instance, NPStream *stream, NPError reason)
void NPN_Status (NPP instance, const char *message)
const char * NPN_UserAgent (NPP instance)
voidNPN_MemAlloc (uint32 size)
void NPN_MemFree (void *ptr)
void NPN_ReloadPlugins (NPBool reloadPages)
JRIEnvNPN_GetJavaEnv (void)
jref NPN_GetJavaPeer (NPP instance)
NPError NPN_GetValue (NPP instance, NPNVariable variable, void *result)

Variables

NPNetscapeFuncsg_pNavigatorFuncs = 0
static NPPluginFuncsg_pluginFuncs

Define Documentation

#define NP_EXPORT   _export

Definition at line 20 of file npwin.cpp.


Function Documentation

reserved

Definition at line 67 of file npwin.cpp.

{
    // trap a NULL ptr 
    if(pFuncs == NULL)
        return NPERR_INVALID_FUNCTABLE_ERROR;

    // if the plugin's function table is smaller than the plugin expects,
    // then they are incompatible, and should return an error 

    pFuncs->version       = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
    pFuncs->newp          = NPP_New;
    pFuncs->destroy       = NPP_Destroy;
    pFuncs->setwindow     = NPP_SetWindow;
    pFuncs->newstream     = NPP_NewStream;
    pFuncs->destroystream = NPP_DestroyStream;
    pFuncs->asfile        = NPP_StreamAsFile;
    pFuncs->writeready    = NPP_WriteReady;
    pFuncs->write         = NPP_Write;
    pFuncs->print         = NPP_Print;
    pFuncs->event         = 0;       
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
    pFuncs->getvalue      = NPP_GetValue;
    pFuncs->setvalue      = NPP_SetValue;
#endif

       g_pluginFuncs          = pFuncs;

    return NPERR_NO_ERROR;
}

Here is the call graph for this function:

Definition at line 104 of file npwin.cpp.

{
    // trap a NULL ptr 
    if(pFuncs == NULL)
        return NPERR_INVALID_FUNCTABLE_ERROR;

    g_pNavigatorFuncs = pFuncs; // save it for future reference 

    // if the plugin's major ver level is lower than the Navigator's,
    // then they are incompatible, and should return an error 
    if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
        return NPERR_INCOMPATIBLE_VERSION_ERROR;

       // We have to defer these assignments until g_pNavigatorFuncs is set
    int navMinorVers = g_pNavigatorFuncs->version & 0xFF;

       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              g_pluginFuncs->urlnotify = NPP_URLNotify;
       }
       
#ifdef WIN32 // An ugly hack, because Win16 lags behind in Java
       if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
#else
       if( navMinorVers >= NPVERS_WIN16_HAS_LIVECONNECT )
#endif // WIN32
              g_pluginFuncs->javaClass = Private_GetJavaClass();
       }

Here is the call graph for this function:

Definition at line 145 of file npwin.cpp.

Here is the call graph for this function:

NPError NPN_DestroyStream ( NPP  instance,
NPStream stream,
NPError  reason 
)

Definition at line 264 of file npwin.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       NPError err;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}

Here is the caller graph for this function:

Definition at line 316 of file npwin.cpp.

Here is the caller graph for this function:

jref NPN_GetJavaPeer ( NPP  instance)

Definition at line 321 of file npwin.cpp.

{
       return g_pNavigatorFuncs->getJavaPeer(instance);
}

Here is the caller graph for this function:

NPError NPN_GetURL ( NPP  instance,
const char *  url,
const char *  target 
)

Definition at line 193 of file npwin.cpp.

{
    return g_pNavigatorFuncs->geturl(instance, url, target);
}

Here is the caller graph for this function:

NPError NPN_GetURLNotify ( NPP  instance,
const char *  url,
const char *  target,
void notifyData 
)

Definition at line 178 of file npwin.cpp.

{
       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
       NPError err;
       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}

Here is the caller graph for this function:

NPError NPN_GetValue ( NPP  instance,
NPNVariable  variable,
void result 
)

Definition at line 326 of file npwin.cpp.

{
    return g_pNavigatorFuncs->getvalue(instance, variable, result);
}

Here is the caller graph for this function:

void* NPN_MemAlloc ( uint32  size)

Definition at line 297 of file npwin.cpp.

Here is the caller graph for this function:

void NPN_MemFree ( void ptr)

Definition at line 304 of file npwin.cpp.

Here is the caller graph for this function:

NPError NPN_NewStream ( NPP  instance,
NPMIMEType  type,
const char *  target,
NPStream **  stream 
)

Definition at line 229 of file npwin.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       NPError err;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}

Here is the caller graph for this function:

NPError NPN_PostURL ( NPP  instance,
const char *  url,
const char *  window,
uint32  len,
const char *  buf,
NPBool  file 
)

Definition at line 212 of file npwin.cpp.

{
    return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
}

Here is the caller graph for this function:

NPError NPN_PostURLNotify ( NPP  instance,
const char *  url,
const char *  window,
uint32  len,
const char *  buf,
NPBool  file,
void notifyData 
)

Definition at line 198 of file npwin.cpp.

{
       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
       NPError err;
       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}

Here is the caller graph for this function:

void NPN_ReloadPlugins ( NPBool  reloadPages)

Definition at line 311 of file npwin.cpp.

{
    g_pNavigatorFuncs->reloadplugins(reloadPages);
}

Here is the caller graph for this function:

NPError NPN_RequestRead ( NPStream stream,
NPByteRange rangeList 
)

Definition at line 221 of file npwin.cpp.

{
    return g_pNavigatorFuncs->requestread(stream, rangeList);
}

Here is the caller graph for this function:

void NPN_Status ( NPP  instance,
const char *  message 
)

Definition at line 280 of file npwin.cpp.

{
    g_pNavigatorFuncs->status(instance, message);
}

Here is the caller graph for this function:

const char* NPN_UserAgent ( NPP  instance)

Definition at line 287 of file npwin.cpp.

{
    return g_pNavigatorFuncs->uagent(instance);
}

Here is the caller graph for this function:

void NPN_Version ( int plugin_major,
int plugin_minor,
int netscape_major,
int netscape_minor 
)

Definition at line 168 of file npwin.cpp.

{
    *plugin_major   = NP_VERSION_MAJOR;
    *plugin_minor   = NP_VERSION_MINOR;
    *netscape_major = HIBYTE(g_pNavigatorFuncs->version);
    *netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
}

Here is the caller graph for this function:

int32 NPN_Write ( NPP  instance,
NPStream stream,
int32  len,
void buffer 
)

Definition at line 246 of file npwin.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       int32 result;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
       }
       else {
              result = -1;
       }
       return result;
}

Here is the caller graph for this function:

Definition at line 232 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_Initialize()\n"));
    _Module.Lock();
    return NPERR_NO_ERROR;
}

Definition at line 35 of file npwin.cpp.

{
    jref clazz = NPP_GetJavaClass();
    if (clazz) {
              JRIEnv* env = NPN_GetJavaEnv();
              return JRI_NewGlobalRef(env, clazz);
    }
    return NULL;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 56 of file npwin.cpp.

Definition at line 24 of file npwin.cpp.