Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
np_entry.cpp File Reference
#include "xp.h"
#include "npapi.h"
#include "npupp.h"
#include "epmanager.h"
#include "logger.h"

Go to the source code of this file.

Functions

NPError WINAPI NP_GetEntryPoints (NPPluginFuncs *pFuncs)
NPError WINAPI NP_Initialize (NPNetscapeFuncs *pFuncs)
NPError WINAPI NP_Shutdown ()

Variables

NPPEntryPointManagerepManager = NULL
Loggerlogger = NULL
NPNetscapeFuncs NPNFuncs

Function Documentation

NPError WINAPI NP_GetEntryPoints ( NPPluginFuncs pFuncs)

Definition at line 54 of file np_entry.cpp.

{
  // create the logger
  if(!logger)
  {
    logger = NewLogger();
    if(logger)
    {
      logger->platformInit();
      logger->init();
    }
  }

  if(logger)
    logger->logNS_NP_GetEntryPoints();

  if(pFuncs == NULL)
    return NPERR_INVALID_FUNCTABLE_ERROR;

  if(pFuncs->size < sizeof(NPPluginFuncs))
    return NPERR_INVALID_FUNCTABLE_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         = NPP_HandleEvent;
  pFuncs->urlnotify     = NPP_URLNotify;
  pFuncs->getvalue      = NPP_GetValue;
  pFuncs->setvalue      = NPP_SetValue;
  pFuncs->javaClass     = NULL;

  return NPERR_NO_ERROR;
}

Here is the call graph for this function:

NPError WINAPI NP_Initialize ( NPNetscapeFuncs pFuncs)

Definition at line 95 of file np_entry.cpp.

Here is the call graph for this function:

NPError WINAPI NP_Shutdown ( void  )

Definition at line 152 of file np_entry.cpp.

{
  // should be safe because if they've already been called shutdown procs must be NULL
  if(epManager)
    epManager->callNP_ShutdownAll(); // this will log the action

  if(logger)
  {
    logger->shut();
    logger->platformShut();
    DeleteLogger(logger);
    logger = NULL;
  }

  delete epManager;

  return NPERR_NO_ERROR;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 48 of file np_entry.cpp.

Definition at line 50 of file np_entry.cpp.

Definition at line 52 of file np_entry.cpp.