Classes | Defines | Typedefs | Enumerations | Functions

npruntime.h File Reference

#include "nptypes.h"
Include dependency graph for npruntime.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  _NPString
struct  _NPVariant
struct  NPClass
struct  NPObject

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   3
#define NP_CLASS_STRUCT_VERSION_ENUM   2
#define NP_CLASS_STRUCT_VERSION_CTOR   3
#define NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass)   ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM)
#define NP_CLASS_STRUCT_VERSION_HAS_CTOR(npclass)   ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR)

Typedefs

typedef struct NPObject NPObject
typedef struct NPClass NPClass
typedef char NPUTF8
typedef struct _NPString NPString
typedef struct _NPVariant NPVariant
typedef void * NPIdentifier
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)
typedef bool(* NPEnumerationFunctionPtr )(NPObject *npobj, NPIdentifier **value, uint32_t *count)
typedef bool(* NPConstructFunctionPtr )(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)

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)
bool NPN_Enumerate (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count)
bool NPN_Construct (NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
void NPN_SetException (NPObject *npobj, const NPUTF8 *message)

Define Documentation

#define BOOLEAN_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Bool;                                           \
    (_v).value.boolValue = !!(_val);                                          \
NP_END_MACRO
#define DOUBLE_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Double;                                         \
    (_v).value.doubleValue = _val;                                            \
NP_END_MACRO
#define INT32_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Int32;                                          \
    (_v).value.intValue = _val;                                               \
NP_END_MACRO
#define NP_BEGIN_MACRO   do {
#define NP_CLASS_STRUCT_VERSION   3
#define NP_CLASS_STRUCT_VERSION_CTOR   3
#define NP_CLASS_STRUCT_VERSION_ENUM   2
#define NP_CLASS_STRUCT_VERSION_HAS_CTOR (   npclass  )     ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR)
#define NP_CLASS_STRUCT_VERSION_HAS_ENUM (   npclass  )     ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM)
#define NP_END_MACRO   } while (0)
#define NPVARIANT_IS_BOOLEAN (   _v  )     ((_v).type == NPVariantType_Bool)
#define NPVARIANT_IS_DOUBLE (   _v  )     ((_v).type == NPVariantType_Double)
#define NPVARIANT_IS_INT32 (   _v  )     ((_v).type == NPVariantType_Int32)
#define NPVARIANT_IS_NULL (   _v  )     ((_v).type == NPVariantType_Null)
#define NPVARIANT_IS_OBJECT (   _v  )     ((_v).type == NPVariantType_Object)
#define NPVARIANT_IS_STRING (   _v  )     ((_v).type == NPVariantType_String)
#define NPVARIANT_IS_VOID (   _v  )     ((_v).type == NPVariantType_Void)
#define NPVARIANT_TO_BOOLEAN (   _v  )     ((_v).value.boolValue)
#define NPVARIANT_TO_DOUBLE (   _v  )     ((_v).value.doubleValue)
#define NPVARIANT_TO_INT32 (   _v  )     ((_v).value.intValue)
#define NPVARIANT_TO_OBJECT (   _v  )     ((_v).value.objectValue)
#define NPVARIANT_TO_STRING (   _v  )     ((_v).value.stringValue)
#define NULL_TO_NPVARIANT (   _v  ) 
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Null;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO
#define OBJECT_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Object;                                         \
    (_v).value.objectValue = _val;                                            \
NP_END_MACRO
#define STRINGN_TO_NPVARIANT (   _val,
  _len,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, uint32_t(_len) };                                  \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO
#define STRINGZ_TO_NPVARIANT (   _val,
  _v 
)
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, uint32_t(strlen(_val)) };                          \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO
#define VOID_TO_NPVARIANT (   _v  ) 
Value:
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Void;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO

Typedef Documentation

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

Enumeration Type Documentation

Enumerator:
NPVariantType_Void 
NPVariantType_Null 
NPVariantType_Bool 
NPVariantType_Int32 
NPVariantType_Double 
NPVariantType_String 
NPVariantType_Object 

Function Documentation

bool NPN_Construct ( NPP  npp,
NPObject npobj,
const NPVariant args,
uint32_t  argCount,
NPVariant result 
)
NPObject* NPN_CreateObject ( NPP  npp,
NPClass aClass 
)
bool NPN_Enumerate ( NPP  npp,
NPObject npobj,
NPIdentifier **  identifier,
uint32_t *  count 
)
bool NPN_Evaluate ( NPP  npp,
NPObject npobj,
NPString script,
NPVariant result 
)
NPIdentifier NPN_GetIntIdentifier ( int32_t  intid  ) 
bool NPN_GetProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName,
NPVariant result 
)
NPIdentifier NPN_GetStringIdentifier ( const NPUTF8 name  ) 
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_IdentifierIsString ( NPIdentifier  identifier  ) 
int32_t NPN_IntFromIdentifier ( NPIdentifier  identifier  ) 
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 
)
void NPN_ReleaseObject ( NPObject npobj  ) 
void NPN_ReleaseVariantValue ( NPVariant variant  ) 
bool NPN_RemoveProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName 
)
NPObject* NPN_RetainObject ( NPObject npobj  ) 
void NPN_SetException ( NPObject npobj,
const NPUTF8 message 
)
bool NPN_SetProperty ( NPP  npp,
NPObject npobj,
NPIdentifier  propertyName,
const NPVariant value 
)
NPUTF8* NPN_UTF8FromIdentifier ( NPIdentifier  identifier  )