navit  0.5.3-trunk
browserplugin.c File Reference
#include "browserplugin.h"
#include <navit/navit.h>
#include <navit/item.h>
#include <navit/config_.h>
#include <navit/callback.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Data Structures

struct  InstanceData
 
struct  NavitObject
 

Macros

#define PLUGIN_NAME   "Navit Sample Plug-in"
 
#define PLUGIN_DESCRIPTION   PLUGIN_NAME " (Mozilla SDK)"
 
#define PLUGIN_VERSION   "1.0.0.0"
 

Typedefs

typedef struct InstanceData InstanceData
 

Functions

static void fillPluginFunctionTable (NPPluginFuncs *pFuncs)
 
 NP_Initialize (NPNetscapeFuncs *bFuncs, NPPluginFuncs *pFuncs)
 
 NP_GetPluginVersion ()
 
 NP_GetMIMEDescription ()
 
 NP_GetValue (void *future, NPPVariable aVariable, void *aValue)
 
 NP_Shutdown ()
 
NPError NPP_New (NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved)
 
NPError NPP_Destroy (NPP instance, NPSavedData **save)
 
NPError NPP_SetWindow (NPP instance, NPWindow *window)
 
NPError NPP_NewStream (NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16_t *stype)
 
NPError NPP_DestroyStream (NPP instance, NPStream *stream, NPReason reason)
 
int32_t NPP_WriteReady (NPP instance, NPStream *stream)
 
int32_t NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer)
 
void NPP_StreamAsFile (NPP instance, NPStream *stream, const char *fname)
 
void NPP_Print (NPP instance, NPPrint *platformPrint)
 
int16_t NPP_HandleEvent (NPP instance, void *event)
 
void NPP_URLNotify (NPP instance, const char *URL, NPReason reason, void *notifyData)
 
void printIdentifier (NPIdentifier name)
 
NPObject * allocate (NPP npp, NPClass *aClass)
 
void invalidate (NPObject *npobj)
 
bool hasMethod (NPObject *npobj, NPIdentifier name)
 
enum attr_type variant_to_attr_type (const NPVariant *variant)
 
bool invoke (NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
 
bool invokeDefault (NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
 
bool hasProperty (NPObject *npobj, NPIdentifier name)
 
bool getProperty (NPObject *npobj, NPIdentifier name, NPVariant *result)
 
bool setProperty (NPObject *npobj, NPIdentifier name, const NPVariant *value)
 
bool removeProperty (NPObject *npobj, NPIdentifier name)
 
NPError NPP_GetValue (NPP instance, NPPVariable variable, void *value)
 
NPError NPP_SetValue (NPP instance, NPNVariable variable, void *value)
 

Variables

static NPNetscapeFuncs * sBrowserFuncs = NULL
 
struct NPClass navitclass navitclass2
 
struct NPClass navitclass
 

Macro Definition Documentation

◆ PLUGIN_DESCRIPTION

#define PLUGIN_DESCRIPTION   PLUGIN_NAME " (Mozilla SDK)"

◆ PLUGIN_NAME

#define PLUGIN_NAME   "Navit Sample Plug-in"

◆ PLUGIN_VERSION

#define PLUGIN_VERSION   "1.0.0.0"

Typedef Documentation

◆ InstanceData

typedef struct InstanceData InstanceData

Function Documentation

◆ allocate()

NPObject* allocate ( NPP  npp,
NPClass *  aClass 
)

◆ fillPluginFunctionTable()

◆ getProperty()

bool getProperty ( NPObject *  npobj,
NPIdentifier  name,
NPVariant *  result 
)

◆ hasMethod()

bool hasMethod ( NPObject *  npobj,
NPIdentifier  name 
)

◆ hasProperty()

bool hasProperty ( NPObject *  npobj,
NPIdentifier  name 
)

◆ invalidate()

void invalidate ( NPObject *  npobj)

◆ invoke()

◆ invokeDefault()

bool invokeDefault ( NPObject *  npobj,
const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)

◆ NP_GetMIMEDescription()

NP_GetMIMEDescription ( )

◆ NP_GetPluginVersion()

NP_GetPluginVersion ( )

References PLUGIN_VERSION.

◆ NP_GetValue()

NP_GetValue ( void *  future,
NPPVariable  aVariable,
void *  aValue 
)

References PLUGIN_DESCRIPTION, and PLUGIN_NAME.

◆ NP_Initialize()

NP_Initialize ( NPNetscapeFuncs *  bFuncs,
NPPluginFuncs *  pFuncs 
)

◆ NP_Shutdown()

NP_Shutdown ( )

◆ NPP_Destroy()

NPError NPP_Destroy ( NPP  instance,
NPSavedData **  save 
)

Referenced by fillPluginFunctionTable().

◆ NPP_DestroyStream()

NPError NPP_DestroyStream ( NPP  instance,
NPStream *  stream,
NPReason  reason 
)

Referenced by fillPluginFunctionTable().

◆ NPP_GetValue()

NPError NPP_GetValue ( NPP  instance,
NPPVariable  variable,
void *  value 
)

References navitclass, sBrowserFuncs, and value.

Referenced by fillPluginFunctionTable().

◆ NPP_HandleEvent()

int16_t NPP_HandleEvent ( NPP  instance,
void *  event 
)

References expose(), and InstanceData::window.

Referenced by fillPluginFunctionTable().

◆ NPP_New()

NPError NPP_New ( NPMIMEType  pluginType,
NPP  instance,
uint16_t  mode,
int16_t  argc,
char *  argn[],
char *  argv[],
NPSavedData *  saved 
)

◆ NPP_NewStream()

NPError NPP_NewStream ( NPP  instance,
NPMIMEType  type,
NPStream *  stream,
NPBool  seekable,
uint16_t *  stype 
)

Referenced by fillPluginFunctionTable().

◆ NPP_Print()

void NPP_Print ( NPP  instance,
NPPrint *  platformPrint 
)

Referenced by fillPluginFunctionTable().

◆ NPP_SetValue()

NPError NPP_SetValue ( NPP  instance,
NPNVariable  variable,
void *  value 
)

Referenced by fillPluginFunctionTable().

◆ NPP_SetWindow()

NPError NPP_SetWindow ( NPP  instance,
NPWindow *  window 
)

◆ NPP_StreamAsFile()

void NPP_StreamAsFile ( NPP  instance,
NPStream *  stream,
const char *  fname 
)

Referenced by fillPluginFunctionTable().

◆ NPP_URLNotify()

void NPP_URLNotify ( NPP  instance,
const char *  URL,
NPReason  reason,
void *  notifyData 
)

Referenced by fillPluginFunctionTable().

◆ NPP_Write()

int32_t NPP_Write ( NPP  instance,
NPStream *  stream,
int32_t  offset,
int32_t  len,
void *  buffer 
)

Referenced by fillPluginFunctionTable().

◆ NPP_WriteReady()

int32_t NPP_WriteReady ( NPP  instance,
NPStream *  stream 
)

Referenced by fillPluginFunctionTable().

◆ printIdentifier()

void printIdentifier ( NPIdentifier  name)

References name, sBrowserFuncs, and attr::str.

Referenced by hasMethod(), hasProperty(), and invoke().

◆ removeProperty()

bool removeProperty ( NPObject *  npobj,
NPIdentifier  name 
)

◆ setProperty()

bool setProperty ( NPObject *  npobj,
NPIdentifier  name,
const NPVariant *  value 
)

◆ variant_to_attr_type()

enum attr_type variant_to_attr_type ( const NPVariant *  variant)

Referenced by invoke().

Variable Documentation

◆ navitclass

struct NPClass navitclass
Initial value:
= {
1,
NULL,
}
bool setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
Definition: browserplugin.c:433
bool removeProperty(NPObject *npobj, NPIdentifier name)
Definition: browserplugin.c:439
void invalidate(NPObject *npobj)
Definition: browserplugin.c:277
NPObject * allocate(NPP npp, NPClass *aClass)
Definition: browserplugin.c:265
bool invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: browserplugin.c:308
bool hasProperty(NPObject *npobj, NPIdentifier name)
Definition: browserplugin.c:394
bool getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
Definition: browserplugin.c:409
bool hasMethod(NPObject *npobj, NPIdentifier name)
Definition: browserplugin.c:282
bool invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: browserplugin.c:388

Referenced by getProperty(), invoke(), and NPP_GetValue().

◆ navitclass2

struct NPClass navitclass2

◆ sBrowserFuncs

NPNetscapeFuncs* sBrowserFuncs = NULL
static