Back to index

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

Go to the source code of this file.

Classes

struct  _NPString
struct  _NPVariant
struct  NPClass
struct  NPObject
union  _NPVariant.value

Defines

#define NP_BEGIN_MACRO   do {
#define NP_END_MACRO   } while (0)
#define NPVARIANT_IS_VOID(_v)   ((_v).type == NPVariantType_Void)
#define NPVARIANT_IS_NULL(_v)   ((_v).type == NPVariantType_Null)
#define NPVARIANT_IS_BOOLEAN(_v)   ((_v).type == NPVariantType_Bool)
#define NPVARIANT_IS_INT32(_v)   ((_v).type == NPVariantType_Int32)
#define NPVARIANT_IS_DOUBLE(_v)   ((_v).type == NPVariantType_Double)
#define NPVARIANT_IS_STRING(_v)   ((_v).type == NPVariantType_String)
#define NPVARIANT_IS_OBJECT(_v)   ((_v).type == NPVariantType_Object)
#define NPVARIANT_TO_BOOLEAN(_v)   ((_v).value.boolValue)
#define NPVARIANT_TO_INT32(_v)   ((_v).value.intValue)
#define NPVARIANT_TO_DOUBLE(_v)   ((_v).value.doubleValue)
#define NPVARIANT_TO_STRING(_v)   ((_v).value.stringValue)
#define NPVARIANT_TO_OBJECT(_v)   ((_v).value.objectValue)
#define VOID_TO_NPVARIANT(_v)
#define NULL_TO_NPVARIANT(_v)
#define BOOLEAN_TO_NPVARIANT(_val, _v)
#define INT32_TO_NPVARIANT(_val, _v)
#define DOUBLE_TO_NPVARIANT(_val, _v)
#define STRINGZ_TO_NPVARIANT(_val, _v)
#define STRINGN_TO_NPVARIANT(_val, _len, _v)
#define OBJECT_TO_NPVARIANT(_val, _v)
#define NP_CLASS_STRUCT_VERSION   1

Typedefs

typedef struct NPObject
typedef struct NPClass
typedef char NPUTF8
typedef struct _NPString NPString
typedef struct _NPVariant NPVariant
typedef voidNPIdentifier
typedef NPObject *(* NPAllocateFunctionPtr )(NPP npp, NPClass *aClass)
typedef void(* NPDeallocateFunctionPtr )(NPObject *npobj)
typedef void(* NPInvalidateFunctionPtr )(NPObject *npobj)
typedef bool(* NPHasMethodFunctionPtr )(NPObject *npobj, NPIdentifier name)
typedef bool(* NPInvokeFunctionPtr )(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
typedef bool(* NPInvokeDefaultFunctionPtr )(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
typedef bool(* NPHasPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name)
typedef bool(* NPGetPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name, NPVariant *result)
typedef bool(* NPSetPropertyFunctionPtr )(NPObject *npobj, NPIdentifier name, const NPVariant *value)
typedef bool(* NPRemovePropertyFunctionPtr )(NPObject *npobj, NPIdentifier name)

Enumerations

enum  NPVariantType {
  NPVariantType_Void, NPVariantType_Null, NPVariantType_Bool, NPVariantType_Int32,
  NPVariantType_Double, NPVariantType_String, NPVariantType_Object
}

Functions

void NPN_ReleaseVariantValue (NPVariant *variant)
NPIdentifier NPN_GetStringIdentifier (const NPUTF8 *name)
void NPN_GetStringIdentifiers (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers)
NPIdentifier NPN_GetIntIdentifier (int32_t intid)
bool NPN_IdentifierIsString (NPIdentifier identifier)
NPUTF8NPN_UTF8FromIdentifier (NPIdentifier identifier)
int32_t NPN_IntFromIdentifier (NPIdentifier identifier)
NPObjectNPN_CreateObject (NPP npp, NPClass *aClass)
NPObjectNPN_RetainObject (NPObject *npobj)
void NPN_ReleaseObject (NPObject *npobj)
bool NPN_Invoke (NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result)
bool NPN_InvokeDefault (NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
bool NPN_Evaluate (NPP npp, NPObject *npobj, NPString *script, NPVariant *result)
bool NPN_GetProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result)
bool NPN_SetProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value)
bool NPN_RemoveProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName)
bool NPN_HasProperty (NPP npp, NPObject *npobj, NPIdentifier propertyName)
bool NPN_HasMethod (NPP npp, NPObject *npobj, NPIdentifier methodName)
void NPN_SetException (NPObject *npobj, const NPUTF8 *message)

Class Documentation

struct _NPString

Definition at line 117 of file npruntime.h.

Class Members
const NPUTF8 * utf8characters
uint32_t utf8length
struct _NPVariant

Definition at line 132 of file npruntime.h.

Class Members
NPVariantType type
union _NPVariant value
struct NPClass

Definition at line 314 of file npruntime.h.

Collaboration diagram for NPClass:
Class Members
NPAllocateFunctionPtr allocate
NPDeallocateFunctionPtr deallocate
NPGetPropertyFunctionPtr getProperty
NPHasMethodFunctionPtr hasMethod
NPHasPropertyFunctionPtr hasProperty
NPInvalidateFunctionPtr invalidate
NPInvokeFunctionPtr invoke
NPInvokeDefaultFunctionPtr invokeDefault
NPRemovePropertyFunctionPtr removeProperty
NPSetPropertyFunctionPtr setProperty
uint32_t structVersion
union _NPVariant.value

Definition at line 134 of file npruntime.h.

Class Members
bool boolValue
double doubleValue
uint32_t intValue
NPObject * objectValue
NPString stringValue

Define Documentation

#define BOOLEAN_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Bool;                                           \
    (_v).value.boolValue = !!(_val);                                          \
NP_END_MACRO

Definition at line 181 of file npruntime.h.

#define DOUBLE_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Double;                                         \
    (_v).value.doubleValue = _val;                                            \
NP_END_MACRO

Definition at line 193 of file npruntime.h.

#define INT32_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Int32;                                          \
    (_v).value.intValue = _val;                                               \
NP_END_MACRO

Definition at line 187 of file npruntime.h.

#define NP_BEGIN_MACRO   do {

Definition at line 105 of file npruntime.h.

Definition at line 329 of file npruntime.h.

#define NP_END_MACRO   } while (0)

Definition at line 106 of file npruntime.h.

Definition at line 157 of file npruntime.h.

Definition at line 159 of file npruntime.h.

Definition at line 158 of file npruntime.h.

#define NPVARIANT_IS_NULL (   _v)    ((_v).type == NPVariantType_Null)

Definition at line 156 of file npruntime.h.

Definition at line 161 of file npruntime.h.

Definition at line 160 of file npruntime.h.

#define NPVARIANT_IS_VOID (   _v)    ((_v).type == NPVariantType_Void)

Definition at line 155 of file npruntime.h.

#define NPVARIANT_TO_BOOLEAN (   _v)    ((_v).value.boolValue)

Definition at line 163 of file npruntime.h.

#define NPVARIANT_TO_DOUBLE (   _v)    ((_v).value.doubleValue)

Definition at line 165 of file npruntime.h.

#define NPVARIANT_TO_INT32 (   _v)    ((_v).value.intValue)

Definition at line 164 of file npruntime.h.

#define NPVARIANT_TO_OBJECT (   _v)    ((_v).value.objectValue)

Definition at line 167 of file npruntime.h.

#define NPVARIANT_TO_STRING (   _v)    ((_v).value.stringValue)

Definition at line 166 of file npruntime.h.

Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Null;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO

Definition at line 175 of file npruntime.h.

#define OBJECT_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Object;                                         \
    (_v).value.objectValue = _val;                                            \
NP_END_MACRO

Definition at line 213 of file npruntime.h.

#define STRINGN_TO_NPVARIANT (   _val,
  _len,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, _len };                                            \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO

Definition at line 206 of file npruntime.h.

#define STRINGZ_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, strlen(_val) };                                    \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO

Definition at line 199 of file npruntime.h.

Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Void;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO

Definition at line 169 of file npruntime.h.


Typedef Documentation

Definition at line 277 of file npruntime.h.

typedef struct NPClass

Definition at line 114 of file npruntime.h.

Definition at line 278 of file npruntime.h.

Definition at line 289 of file npruntime.h.

Definition at line 280 of file npruntime.h.

Definition at line 288 of file npruntime.h.

typedef void* NPIdentifier

Definition at line 242 of file npruntime.h.

Definition at line 279 of file npruntime.h.

Definition at line 284 of file npruntime.h.

Definition at line 281 of file npruntime.h.

typedef struct NPObject

Definition at line 113 of file npruntime.h.

Definition at line 293 of file npruntime.h.

Definition at line 291 of file npruntime.h.

typedef struct _NPString NPString
typedef char NPUTF8

Definition at line 116 of file npruntime.h.

typedef struct _NPVariant NPVariant

Enumeration Type Documentation

Enumerator:
NPVariantType_Void 
NPVariantType_Null 
NPVariantType_Bool 
NPVariantType_Int32 
NPVariantType_Double 
NPVariantType_String 
NPVariantType_Object 

Definition at line 122 of file npruntime.h.


Function Documentation

NPObject* NPN_CreateObject ( NPP  npp,
NPClass aClass 
)
bool NPN_Evaluate ( NPP  npp,
NPObject npobj,
NPString script,
NPVariant result 
)
bool NPN_GetProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName,
NPVariant result 
)
void NPN_GetStringIdentifiers ( const NPUTF8 **  names,
int32_t  nameCount,
NPIdentifier identifiers 
)
bool NPN_HasMethod ( NPP  npp,
NPObject npobj,
NPIdentifier  methodName 
)
bool NPN_HasProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName 
)
bool NPN_Invoke ( NPP  npp,
NPObject npobj,
NPIdentifier  methodName,
const NPVariant args,
uint32_t  argCount,
NPVariant result 
)
bool NPN_InvokeDefault ( NPP  npp,
NPObject npobj,
const NPVariant args,
uint32_t  argCount,
NPVariant result 
)
bool NPN_RemoveProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName 
)
void NPN_SetException ( NPObject npobj,
const NPUTF8 message 
)
bool NPN_SetProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName,
const NPVariant value 
)