Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions
npapi.h File Reference
#include "jri.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _NPP
struct  _NPStream
struct  _NPByteRange
struct  _NPSavedData
struct  _NPRect
struct  _NPWindow
struct  _NPFullPrint
struct  _NPEmbedPrint
struct  _NPPrint
union  _NPPrint.print

Defines

#define NP_VERSION_MAJOR   0
#define NP_VERSION_MINOR   11
#define FALSE   (0)
#define TRUE   (1)
#define NULL   (0L)
#define NP_EMBED   1
#define NP_FULL   2
#define NP_NORMAL   1
#define NP_SEEK   2
#define NP_ASFILE   3
#define NP_ASFILEONLY   4
#define NP_MAXREADY   (((unsigned)(~0)<<1)>>1)
#define NPERR_BASE   0
#define NPERR_NO_ERROR   (NPERR_BASE + 0)
#define NPERR_GENERIC_ERROR   (NPERR_BASE + 1)
#define NPERR_INVALID_INSTANCE_ERROR   (NPERR_BASE + 2)
#define NPERR_INVALID_FUNCTABLE_ERROR   (NPERR_BASE + 3)
#define NPERR_MODULE_LOAD_FAILED_ERROR   (NPERR_BASE + 4)
#define NPERR_OUT_OF_MEMORY_ERROR   (NPERR_BASE + 5)
#define NPERR_INVALID_PLUGIN_ERROR   (NPERR_BASE + 6)
#define NPERR_INVALID_PLUGIN_DIR_ERROR   (NPERR_BASE + 7)
#define NPERR_INCOMPATIBLE_VERSION_ERROR   (NPERR_BASE + 8)
#define NPERR_INVALID_PARAM   (NPERR_BASE + 9)
#define NPERR_INVALID_URL   (NPERR_BASE + 10)
#define NPERR_FILE_NOT_FOUND   (NPERR_BASE + 11)
#define NPERR_NO_DATA   (NPERR_BASE + 12)
#define NPERR_STREAM_NOT_SEEKABLE   (NPERR_BASE + 13)
#define NPRES_BASE   0
#define NPRES_DONE   (NPRES_BASE + 0)
#define NPRES_NETWORK_ERR   (NPRES_BASE + 1)
#define NPRES_USER_BREAK   (NPRES_BASE + 2)
#define NP_NOERR   NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
#define NP_EINVAL   NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
#define NP_EABORT   NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
#define NPVERS_HAS_STREAMOUTPUT   8
#define NPVERS_HAS_NOTIFICATION   9
#define NPVERS_HAS_LIVECONNECT   9
#define NPVERS_WIN16_HAS_LIVECONNECT   9
#define NPVERS_68K_HAS_LIVECONNECT   11
#define NPVERS_HAS_WINDOWLESS   11
#define NP_LOADDS

Typedefs

typedef unsigned short uint16
typedef unsigned long uint32
typedef short int16
typedef long int32
typedef unsigned char NPBool
typedef int16 NPError
typedef int16 NPReason
typedef char * NPMIMEType
typedef struct _NPP NPP_t
typedef NPP_tNPP
typedef struct _NPStream NPStream
typedef struct _NPByteRange NPByteRange
typedef struct _NPSavedData NPSavedData
typedef struct _NPRect NPRect
typedef struct _NPWindow NPWindow
typedef struct _NPFullPrint NPFullPrint
typedef struct _NPEmbedPrint NPEmbedPrint
typedef struct _NPPrint NPPrint
typedef voidNPEvent
typedef voidNPRegion

Enumerations

enum  NPPVariable {
  NPPVpluginNameString = 1, NPPVpluginDescriptionString, NPPVpluginWindowBool, NPPVpluginTransparentBool,
  NPPVpluginNameString = 1, NPPVpluginDescriptionString, NPPVpluginWindowBool, NPPVpluginTransparentBool,
  NPPVjavaClass, NPPVpluginWindowSize, NPPVpluginTimerInterval, NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
  NPPVpluginScriptableIID = 11, NPPVjavascriptPushCallerBool = 12, NPPVpluginKeepLibraryInMemory = 13, NPPVpluginNeedsXEmbed = 14,
  NPPVpluginScriptableNPObject = 15, NPPVformValue = 16
}
enum  NPNVariable {
  NPNVxDisplay = 1, NPNVxtAppContext, NPNVnetscapeWindow, NPNVjavascriptEnabledBool,
  NPNVasdEnabledBool, NPNVisOfflineBool, NPNVxDisplay = 1, NPNVxtAppContext,
  NPNVnetscapeWindow, NPNVjavascriptEnabledBool, NPNVasdEnabledBool, NPNVisOfflineBool,
  NPNVserviceManager = (10 | NP_ABI_MASK), NPNVDOMElement = (11 | NP_ABI_MASK), NPNVDOMWindow = (12 | NP_ABI_MASK), NPNVToolkit = (13 | NP_ABI_MASK),
  NPNVSupportsXEmbedBool = 14, NPNVWindowNPObject = 15, NPNVPluginElementNPObject = 16
}
enum  NPWindowType { NPWindowTypeWindow = 1, NPWindowTypeDrawable, NPWindowTypeWindow = 1, NPWindowTypeDrawable }

Functions

NPError NPP_Initialize (void)
void NPP_Shutdown (void)
NPError NP_LOADDS NPP_New (NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
NPError NP_LOADDS NPP_Destroy (NPP instance, NPSavedData **save)
NPError NP_LOADDS NPP_SetWindow (NPP instance, NPWindow *window)
NPError NP_LOADDS NPP_NewStream (NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
NPError NP_LOADDS NPP_DestroyStream (NPP instance, NPStream *stream, NPReason reason)
int32 NP_LOADDS NPP_WriteReady (NPP instance, NPStream *stream)
int32 NP_LOADDS NPP_Write (NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
void NP_LOADDS NPP_StreamAsFile (NPP instance, NPStream *stream, const char *fname)
void NP_LOADDS NPP_Print (NPP instance, NPPrint *platformPrint)
int16 NPP_HandleEvent (NPP instance, void *event)
void NP_LOADDS NPP_URLNotify (NPP instance, const char *url, NPReason reason, void *notifyData)
jref NP_LOADDS NPP_GetJavaClass (void)
NPError NPP_GetValue (void *instance, NPPVariable variable, void *value)
NPError NPP_SetValue (void *instance, NPNVariable variable, void *value)
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 *target, uint32 len, const char *buf, NPBool file, void *notifyData)
NPError NPN_PostURL (NPP instance, const char *url, const char *target, 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, NPReason reason)
void NPN_Status (NPP instance, const char *message)
const char * NPN_UserAgent (NPP instance)
voidNPN_MemAlloc (uint32 size)
void NPN_MemFree (void *ptr)
uint32 NPN_MemFlush (uint32 size)
void NPN_ReloadPlugins (NPBool reloadPages)
JRIEnvNPN_GetJavaEnv (void)
jref NPN_GetJavaPeer (NPP instance)
NPError NPN_GetValue (NPP instance, NPNVariable variable, void *value)
NPError NPN_SetValue (NPP instance, NPPVariable variable, void *value)
void NPN_InvalidateRect (NPP instance, NPRect *invalidRect)
void NPN_InvalidateRegion (NPP instance, NPRegion invalidRegion)
void NPN_ForceRedraw (NPP instance)

Class Documentation

struct _NPP

Definition at line 106 of file npapi.h.

Class Members
void * ndata
void * pdata
struct _NPStream

Definition at line 115 of file npapi.h.

Class Members
uint32 end
const char * headers
uint32 lastmodified
void * ndata
void * notifyData
void * pdata
const char * url
struct _NPByteRange

Definition at line 126 of file npapi.h.

Collaboration diagram for _NPByteRange:
Class Members
uint32 length
struct _NPByteRange * next
int32 offset
struct _NPSavedData

Definition at line 134 of file npapi.h.

Class Members
void * buf
int32 len
struct _NPRect

Definition at line 141 of file npapi.h.

Class Members
uint16 bottom
uint16 left
uint16 right
uint16 top
struct _NPWindow

Definition at line 218 of file npapi.h.

Collaboration diagram for _NPWindow:
Class Members
NPRect clipRect
uint32 height
NPWindowType type
uint32 width
void * window
int32 x
int32 y
struct _NPFullPrint

Definition at line 234 of file npapi.h.

Class Members
void * platformPrint
NPBool pluginPrinted
NPBool printOne
struct _NPEmbedPrint

Definition at line 243 of file npapi.h.

Collaboration diagram for _NPEmbedPrint:
Class Members
void * platformPrint
NPWindow window
struct _NPPrint

Definition at line 249 of file npapi.h.

Class Members
uint16 mode
union _NPPrint print
union _NPPrint print
union _NPPrint.print

Definition at line 252 of file npapi.h.

Class Members
NPEmbedPrint embedPrint
NPFullPrint fullPrint

Define Documentation

#define FALSE   (0)

Definition at line 79 of file npapi.h.

#define NP_ASFILE   3

Definition at line 317 of file npapi.h.

Definition at line 318 of file npapi.h.

#define NP_EABORT   NP_EABORT_is_obsolete_use_NPRES_USER_BREAK

Definition at line 363 of file npapi.h.

#define NP_EINVAL   NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR

Definition at line 362 of file npapi.h.

#define NP_EMBED   1

Definition at line 309 of file npapi.h.

#define NP_FULL   2

Definition at line 310 of file npapi.h.

Definition at line 383 of file npapi.h.

#define NP_MAXREADY   (((unsigned)(~0)<<1)>>1)

Definition at line 320 of file npapi.h.

#define NP_NOERR   NP_NOERR_is_obsolete_use_NPERR_NO_ERROR

Definition at line 361 of file npapi.h.

#define NP_NORMAL   1

Definition at line 315 of file npapi.h.

#define NP_SEEK   2

Definition at line 316 of file npapi.h.

Definition at line 48 of file npapi.h.

Definition at line 49 of file npapi.h.

#define NPERR_BASE   0

Definition at line 334 of file npapi.h.

Definition at line 346 of file npapi.h.

Definition at line 336 of file npapi.h.

Definition at line 343 of file npapi.h.

Definition at line 338 of file npapi.h.

Definition at line 337 of file npapi.h.

Definition at line 344 of file npapi.h.

Definition at line 342 of file npapi.h.

Definition at line 341 of file npapi.h.

Definition at line 345 of file npapi.h.

Definition at line 339 of file npapi.h.

Definition at line 347 of file npapi.h.

Definition at line 335 of file npapi.h.

Definition at line 340 of file npapi.h.

Definition at line 348 of file npapi.h.

#define NPRES_BASE   0

Definition at line 353 of file npapi.h.

Definition at line 354 of file npapi.h.

Definition at line 355 of file npapi.h.

Definition at line 356 of file npapi.h.

Definition at line 372 of file npapi.h.

Definition at line 370 of file npapi.h.

Definition at line 369 of file npapi.h.

Definition at line 368 of file npapi.h.

Definition at line 373 of file npapi.h.

Definition at line 371 of file npapi.h.

#define NULL   (0L)

Definition at line 85 of file npapi.h.

#define TRUE   (1)

Definition at line 82 of file npapi.h.


Typedef Documentation

typedef short int16

Definition at line 68 of file npapi.h.

typedef long int32

Definition at line 74 of file npapi.h.

typedef unsigned char NPBool

Definition at line 88 of file npapi.h.

typedef struct _NPByteRange NPByteRange
typedef struct _NPEmbedPrint NPEmbedPrint
typedef NPError

Definition at line 89 of file npapi.h.

typedef void* NPEvent

Definition at line 271 of file npapi.h.

typedef struct _NPFullPrint NPFullPrint
typedef char* NPMIMEType

Definition at line 91 of file npapi.h.

typedef NPP_t* NPP

Definition at line 112 of file npapi.h.

typedef struct _NPP NPP_t
typedef struct _NPPrint NPPrint
typedef int16 NPReason

Definition at line 90 of file npapi.h.

typedef struct _NPRect NPRect
typedef void* NPRegion

Definition at line 281 of file npapi.h.

typedef struct _NPSavedData NPSavedData
typedef struct _NPStream NPStream
typedef struct _NPWindow NPWindow
typedef unsigned short uint16

Definition at line 58 of file npapi.h.

typedef unsigned long uint32

Definition at line 64 of file npapi.h.


Enumeration Type Documentation

Enumerator:
NPNVxDisplay 
NPNVxtAppContext 
NPNVnetscapeWindow 
NPNVjavascriptEnabledBool 
NPNVasdEnabledBool 
NPNVisOfflineBool 
NPNVxDisplay 
NPNVxtAppContext 
NPNVnetscapeWindow 
NPNVjavascriptEnabledBool 
NPNVasdEnabledBool 
NPNVisOfflineBool 
NPNVserviceManager 
NPNVDOMElement 
NPNVDOMWindow 
NPNVToolkit 
NPNVSupportsXEmbedBool 
NPNVWindowNPObject 
NPNVPluginElementNPObject 

Definition at line 200 of file npapi.h.

Enumerator:
NPPVpluginNameString 
NPPVpluginDescriptionString 
NPPVpluginWindowBool 
NPPVpluginTransparentBool 
NPPVpluginNameString 
NPPVpluginDescriptionString 
NPPVpluginWindowBool 
NPPVpluginTransparentBool 
NPPVjavaClass 
NPPVpluginWindowSize 
NPPVpluginTimerInterval 
NPPVpluginScriptableInstance 
NPPVpluginScriptableIID 
NPPVjavascriptPushCallerBool 
NPPVpluginKeepLibraryInMemory 
NPPVpluginNeedsXEmbed 
NPPVpluginScriptableNPObject 
NPPVformValue 

Definition at line 190 of file npapi.h.

Enumerator:
NPWindowTypeWindow 
NPWindowTypeDrawable 
NPWindowTypeWindow 
NPWindowTypeDrawable 

Definition at line 213 of file npapi.h.


Function Documentation

NPError NPN_DestroyStream ( NPP  instance,
NPStream stream,
NPReason  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;
}
void NPN_ForceRedraw ( NPP  instance)

Definition at line 331 of file npn.cpp.

{
    if (!npp)
    {
        return;
    }
    // TODO - windowless plugins
}

Definition at line 316 of file npwin.cpp.

Here is the call graph for this function:

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 call graph for this function:

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);
}
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;
}
NPError NPN_GetValue ( NPP  instance,
NPNVariable  variable,
void value 
)

Definition at line 326 of file npwin.cpp.

{
    return g_pNavigatorFuncs->getvalue(instance, variable, result);
}
void NPN_InvalidateRect ( NPP  instance,
NPRect invalidRect 
)

Definition at line 306 of file npn.cpp.

{
    if (!npp)
    {
        return;
    }

    // TODO - windowless plugins
}
void NPN_InvalidateRegion ( NPP  instance,
NPRegion  invalidRegion 
)

Definition at line 319 of file npn.cpp.

{
    if (!npp)
    {
        return;
    }
    // TODO - windowless plugins
}
void* NPN_MemAlloc ( uint32  size)

Definition at line 297 of file npwin.cpp.

Definition at line 291 of file npn.cpp.

{
    return 0;
}
void NPN_MemFree ( void ptr)

Definition at line 304 of file npwin.cpp.

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;
}
NPError NPN_PostURL ( NPP  instance,
const char *  url,
const char *  target,
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);
}
NPError NPN_PostURLNotify ( NPP  instance,
const char *  url,
const char *  target,
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;
}
void NPN_ReloadPlugins ( NPBool  reloadPages)

Definition at line 311 of file npwin.cpp.

{
    g_pNavigatorFuncs->reloadplugins(reloadPages);
}
NPError NPN_RequestRead ( NPStream stream,
NPByteRange rangeList 
)

Definition at line 221 of file npwin.cpp.

{
    return g_pNavigatorFuncs->requestread(stream, rangeList);
}
NPError NPN_SetValue ( NPP  instance,
NPPVariable  variable,
void value 
)

Definition at line 399 of file npn.cpp.

{
    if (!npp)
    {
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    // TODO windowless
    // NPPVpluginWindowBool
    // NPPVpluginTransparentBool

    return NPERR_GENERIC_ERROR;
}
void NPN_Status ( NPP  instance,
const char *  message 
)

Definition at line 280 of file npwin.cpp.

{
    g_pNavigatorFuncs->status(instance, message);
}
const char* NPN_UserAgent ( NPP  instance)

Definition at line 287 of file npwin.cpp.

{
    return g_pNavigatorFuncs->uagent(instance);
}
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);
}
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;
}
NPError NP_LOADDS NPP_Destroy ( NPP  instance,
NPSavedData **  save 
)

Definition at line 990 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_Destroy()\n"));

    PluginInstanceData *pData = (PluginInstanceData *) instance->pdata;
    if (pData == NULL)
    {
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    if (pData->nType == itControl)
    {
        // Destroy the site
        CControlSiteInstance *pSite = pData->pControlSite;
        if (pSite)
        {
            pSite->Detach();
            pSite->Release();
        }
#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT)
        if (pData->pControlEventSink)
        {
            pData->pControlEventSink->UnsubscribeFromEvents();
            pData->pControlEventSink->Release();
        }
#endif
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
        if (pData->pScriptingPeer)
        {
            pData->pScriptingPeer->Release();
        }
#endif
    }
    else if (pData->nType == itScript)
    {
        // TODO
    }

    if (pData->szUrl)
        free(pData->szUrl);
    if (pData->szContentType)
        free(pData->szContentType);
    delete pData;
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
    MozAxPlugin::Release();
#endif

    instance->pdata = 0;

    return NPERR_NO_ERROR;

}
NPError NP_LOADDS NPP_DestroyStream ( NPP  instance,
NPStream stream,
NPReason  reason 
)

Definition at line 1212 of file LegacyPlugin.cpp.

{
    // because I am handling the stream as a file, I don't do anything here...
    // If I was streaming, I would know that I was done and do anything appropriate
    // to the end of the stream...   
    return NPERR_NO_ERROR;
}

Definition at line 258 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_GetJavaClass()\n"));
#ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
    return liveconnect_GetJavaClass();
#endif
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NPError NPP_GetValue ( void instance,
NPPVariable  variable,
void value 
)
int16 NPP_HandleEvent ( NPP  instance,
void event 
)

Definition at line 249 of file npp_gate.cpp.

{
  if(instance == NULL)
    return 0;

  int16 rv = 0;
  CPlugin * pPlugin = (CPlugin *)instance->pdata;
  if (pPlugin)
    rv = pPlugin->handleEvent(event);

  return rv;
}

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;
}
NPError NP_LOADDS NPP_New ( NPMIMEType  pluginType,
NPP  instance,
uint16  mode,
int16  argc,
char *  argn[],
char *  argv[],
NPSavedData saved 
)

Definition at line 925 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_New()\n"));

    // trap duff args
    if (instance == NULL)
    {
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    PluginInstanceData *pData = new PluginInstanceData;
    if (pData == NULL)
    {
        return NPERR_GENERIC_ERROR;
    }
    pData->pPluginInstance = instance;
    pData->szUrl = NULL;
    pData->szContentType = (pluginType) ? strdup(pluginType) : NULL;
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
    pData->pScriptingPeer = NULL;
#endif

    // Create a plugin according to the mime type
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
    MozAxPlugin::AddRef();
#endif

    NPError rv = NPERR_GENERIC_ERROR;
    /* if (strcmp(pluginType, MIME_OLEOBJECT1) == 0 ||
           strcmp(pluginType, MIME_OLEOBJECT2) == 0) */
    {
        rv = NewControl(pluginType, pData, mode, argc, argn, argv);
    }

    // Test if plugin creation has succeeded and cleanup if it hasn't
    if (rv != NPERR_NO_ERROR)
    {
        if (pData->szContentType)
            free(pData->szContentType);
        if (pData->szUrl)
            free(pData->szUrl);
        delete pData;
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
        MozAxPlugin::Release();
#endif
        return rv;
    }

    instance->pdata = pData;

    return NPERR_NO_ERROR;
}
NPError NP_LOADDS NPP_NewStream ( NPP  instance,
NPMIMEType  type,
NPStream stream,
NPBool  seekable,
uint16 stype 
)

Definition at line 1128 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_NewStream()\n"));

    if(!instance)
    {
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    // save the plugin instance object in the stream instance
    stream->pdata = instance->pdata;
    *stype = NP_ASFILE;
    return NPERR_NO_ERROR;
}
void NP_LOADDS NPP_Print ( NPP  instance,
NPPrint platformPrint 
)

Definition at line 1226 of file LegacyPlugin.cpp.

{
    if(printInfo == NULL)   // trap invalid parm
    {
        return;
    }

//    if (instance != NULL) {
//        CPluginWindow* pluginData = (CPluginWindow*) instance->pdata;
//        pluginData->Print(printInfo);
//    }
}
NPError NPP_SetValue ( void instance,
NPNVariable  variable,
void value 
)
NPError NP_LOADDS NPP_SetWindow ( NPP  instance,
NPWindow window 
)

Definition at line 1061 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_SetWindow()\n"));

    // Reject silly parameters
    if (!window)
    {
        return NPERR_GENERIC_ERROR;
    }

    PluginInstanceData *pData = (PluginInstanceData *) instance->pdata;
    if (pData == NULL)
    {
        return  NPERR_INVALID_INSTANCE_ERROR;
    }

    if (pData->nType == itControl)
    {
        CControlSiteInstance *pSite = pData->pControlSite;
        if (pSite == NULL)
        {
            return NPERR_GENERIC_ERROR;
        }

        HWND hwndParent = (HWND) window->window;
        if (hwndParent)
        {
            RECT rcPos;
            GetClientRect(hwndParent, &rcPos);

            if (pSite->GetParentWindow() == NULL)
            {
                pSite->Attach(hwndParent, rcPos, NULL);
            }
            else
            {
                pSite->SetPosition(rcPos);
            }

            // Ensure clipping on parent to keep child controls happy
            ::SetWindowLong(hwndParent, GWL_STYLE,
                ::GetWindowLong(hwndParent, GWL_STYLE) | WS_CLIPCHILDREN);
        }
    }

    return NPERR_NO_ERROR;
}

Definition at line 244 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_Shutdown()\n"));
#ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
    liveconnect_Shutdown();
#endif
    _Module.Unlock();
}
void NP_LOADDS NPP_StreamAsFile ( NPP  instance,
NPStream stream,
const char *  fname 
)

Definition at line 1154 of file LegacyPlugin.cpp.

{
    ATLTRACE(_T("NPP_StreamAsFile()\n"));

    if(fname == NULL || fname[0] == NULL)
    {
        return;
    }
}
void NP_LOADDS NPP_URLNotify ( NPP  instance,
const char *  url,
NPReason  reason,
void notifyData 
)

Definition at line 1259 of file LegacyPlugin.cpp.

{
    PluginInstanceData *pData = (PluginInstanceData *) instance->pdata;
    if (pData)
    {
        if (pData->szUrl)
            free(pData->szUrl);
        pData->szUrl = strdup(url);
    }
}
int32 NP_LOADDS NPP_Write ( NPP  instance,
NPStream stream,
int32  offset,
int32  len,
void buffer 
)

Definition at line 1198 of file LegacyPlugin.cpp.

{   
    return len;
}
int32 NP_LOADDS NPP_WriteReady ( NPP  instance,
NPStream stream 
)

Definition at line 1187 of file LegacyPlugin.cpp.

{
    return STREAMBUFSIZE;  
}