Gnash  0.8.11dev
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
gnash::GnashPluginScriptObject Class Reference

#include <pluginScriptObject.h>

Inheritance diagram for gnash::GnashPluginScriptObject:

Public Member Functions

 GnashPluginScriptObject ()
 
 GnashPluginScriptObject (NPP npp)
 
 ~GnashPluginScriptObject ()
 
void setControlFD (int x)
 
int getControlFD ()
 
void setHostFD (int x)
 
int getHostFD ()
 
bool SetVariable (const std::string &name, const NPVariant &value)
 
GnashNPVariant GetVariable (const std::string &name)
 
int getReadFD ()
 
int getWriteFD ()
 
int writePlayer (const std::string &data)
 
int writePlayer (int fd, const std::string &data)
 
std::string readPlayer ()
 
std::string readPlayer (int fd)
 
bool Invoke (NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
 
bool AddMethod (NPIdentifier name, NPInvokeFunctionPtr func)
 
void AddProperty (const std::string &name, const std::string &str)
 
void AddProperty (const std::string &name, double num)
 
void AddProperty (const std::string &name, int num)
 

Static Public Member Functions

static NPClass * marshalGetNPClass ()
 
static NPObject * marshalAllocate (NPP npp, NPClass *aClass)
 
static void marshalDeallocate (NPObject *npobj)
 
static void marshalInvalidate (NPObject *npobj)
 
static bool marshalHasMethod (NPObject *npobj, NPIdentifier name)
 
static bool marshalInvoke (NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
 
static bool marshalInvokeDefault (NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
 
static bool marshalHasProperty (NPObject *npobj, NPIdentifier name)
 
static bool marshalGetProperty (NPObject *npobj, NPIdentifier name, NPVariant *result)
 
static bool marshalSetProperty (NPObject *npobj, NPIdentifier name, const NPVariant *value)
 
static bool marshalRemoveProperty (NPObject *npobj, NPIdentifier name)
 
static bool marshalEnumerate (NPObject *npobj, void ***identifier, uint32_t *count)
 
static bool marshalConstruct (NPObject *npobj, const NPVariant *data, uint32_t count, NPVariant *result)
 

Public Attributes

NPP nppinstance
 Plugin instance object. More...
 

Static Public Attributes

static NPClass _npclass
 

Protected Member Functions

void Deallocate ()
 
void Invalidate ()
 
bool HasMethod (NPIdentifier name)
 
bool InvokeDefault (const NPVariant *args, uint32_t argCount, NPVariant *result)
 
bool HasProperty (NPIdentifier name)
 
bool GetProperty (NPIdentifier name, NPVariant *result)
 
bool SetProperty (NPIdentifier name, const NPVariant &value)
 
bool RemoveProperty (NPIdentifier name)
 
bool Enumerate (NPIdentifier **identifier, uint32_t *count)
 
bool Construct (const NPVariant *data, uint32_t argCount, NPVariant *result)
 

Constructor & Destructor Documentation

§ GnashPluginScriptObject() [1/2]

gnash::GnashPluginScriptObject::GnashPluginScriptObject ( )

Referenced by marshalAllocate().

§ GnashPluginScriptObject() [2/2]

gnash::GnashPluginScriptObject::GnashPluginScriptObject ( NPP  npp)

§ ~GnashPluginScriptObject()

gnash::GnashPluginScriptObject::~GnashPluginScriptObject ( )

Member Function Documentation

§ AddMethod()

bool gnash::GnashPluginScriptObject::AddMethod ( NPIdentifier  name,
NPInvokeFunctionPtr  func 
)

§ AddProperty() [1/3]

void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
const std::string &  str 
)

References NPN_GetStringIdentifier(), and SetProperty().

Referenced by AddProperty(), and getWriteFD().

§ AddProperty() [2/3]

void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
double  num 
)

§ AddProperty() [3/3]

void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
int  num 
)

§ Construct()

bool gnash::GnashPluginScriptObject::Construct ( const NPVariant *  data,
uint32_t  argCount,
NPVariant *  result 
)
protected

§ Deallocate()

void gnash::GnashPluginScriptObject::Deallocate ( )
protected

§ Enumerate()

bool gnash::GnashPluginScriptObject::Enumerate ( NPIdentifier **  identifier,
uint32_t *  count 
)
protected

§ getControlFD()

int gnash::GnashPluginScriptObject::getControlFD ( )

§ getHostFD()

int gnash::GnashPluginScriptObject::getHostFD ( )

§ GetProperty()

bool gnash::GnashPluginScriptObject::GetProperty ( NPIdentifier  name,
NPVariant *  result 
)
protected

§ getReadFD()

int gnash::GnashPluginScriptObject::getReadFD ( )
inline

§ GetVariable()

GnashNPVariant gnash::GnashPluginScriptObject::GetVariable ( const std::string &  name)

Get the value of a variable from the standalone player

Parameters
namethe name of the variable to set
Returns
the value as returned by the standalone player

References data, gnash::GnashNPVariant::get(), gnash::log_debug(), gnash::log_error(), gnash::plugin::ExternalInterface::makeInvoke(), gnash::plugin::ExternalInterface::makeString(), gnash::plugin::ExternalInterface::parseXML(), gnash::printNPVariant(), readPlayer(), and writePlayer().

Referenced by gnash::GetVariableCallback().

§ getWriteFD()

int gnash::GnashPluginScriptObject::getWriteFD ( )
inline

§ HasMethod()

bool gnash::GnashPluginScriptObject::HasMethod ( NPIdentifier  name)
protected

§ HasProperty()

bool gnash::GnashPluginScriptObject::HasProperty ( NPIdentifier  name)
protected

§ Invalidate()

void gnash::GnashPluginScriptObject::Invalidate ( )
protected

§ Invoke()

bool gnash::GnashPluginScriptObject::Invoke ( NPObject *  npobj,
NPIdentifier  name,
const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)

§ InvokeDefault()

bool gnash::GnashPluginScriptObject::InvokeDefault ( const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)
protected

§ marshalAllocate()

NPObject * gnash::GnashPluginScriptObject::marshalAllocate ( NPP  npp,
NPClass *  aClass 
)
static

§ marshalConstruct()

bool gnash::GnashPluginScriptObject::marshalConstruct ( NPObject *  npobj,
const NPVariant *  data,
uint32_t  count,
NPVariant *  result 
)
static

§ marshalDeallocate()

void gnash::GnashPluginScriptObject::marshalDeallocate ( NPObject *  npobj)
static

§ marshalEnumerate()

bool gnash::GnashPluginScriptObject::marshalEnumerate ( NPObject *  npobj,
void ***  identifier,
uint32_t *  count 
)
static

§ marshalGetNPClass()

NPClass * gnash::GnashPluginScriptObject::marshalGetNPClass ( )
static

§ marshalGetProperty()

bool gnash::GnashPluginScriptObject::marshalGetProperty ( NPObject *  npobj,
NPIdentifier  name,
NPVariant *  result 
)
static

References GetProperty().

§ marshalHasMethod()

bool gnash::GnashPluginScriptObject::marshalHasMethod ( NPObject *  npobj,
NPIdentifier  name 
)
static

§ marshalHasProperty()

bool gnash::GnashPluginScriptObject::marshalHasProperty ( NPObject *  npobj,
NPIdentifier  name 
)
static

References HasProperty().

§ marshalInvalidate()

void gnash::GnashPluginScriptObject::marshalInvalidate ( NPObject *  npobj)
static

§ marshalInvoke()

bool gnash::GnashPluginScriptObject::marshalInvoke ( NPObject *  npobj,
NPIdentifier  name,
const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)
static

References Invoke().

§ marshalInvokeDefault()

bool gnash::GnashPluginScriptObject::marshalInvokeDefault ( NPObject *  npobj,
const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)
static

References InvokeDefault().

§ marshalRemoveProperty()

bool gnash::GnashPluginScriptObject::marshalRemoveProperty ( NPObject *  npobj,
NPIdentifier  name 
)
static

References RemoveProperty().

§ marshalSetProperty()

bool gnash::GnashPluginScriptObject::marshalSetProperty ( NPObject *  npobj,
NPIdentifier  name,
const NPVariant *  value 
)
static

References SetProperty().

§ readPlayer() [1/2]

std::string gnash::GnashPluginScriptObject::readPlayer ( )

§ readPlayer() [2/2]

std::string gnash::GnashPluginScriptObject::readPlayer ( int  fd)

§ RemoveProperty()

bool gnash::GnashPluginScriptObject::RemoveProperty ( NPIdentifier  name)
protected

Referenced by marshalRemoveProperty().

§ setControlFD()

void gnash::GnashPluginScriptObject::setControlFD ( int  x)

Scripting API support. This is where all the protocol support lives. The ControlFD is the file descriptor for the socket connection to the standalone player. This is used when writing to the standalone player from this plugin.

References x.

§ setHostFD()

void gnash::GnashPluginScriptObject::setHostFD ( int  x)

The HostFD is the file descriptor for the socket connection to the standalone player. This is used by this plugin when reading messages from the standalone player.

References x.

§ SetProperty()

bool gnash::GnashPluginScriptObject::SetProperty ( NPIdentifier  name,
const NPVariant &  value 
)
protected

References name.

Referenced by AddProperty(), and marshalSetProperty().

§ SetVariable()

bool gnash::GnashPluginScriptObject::SetVariable ( const std::string &  name,
const NPVariant &  value 
)

Set a variable in the standalone player

Parameters
namethe name of the variable to set
valuethe value to set the variable to
Returns
true or false based on the status of the invoke call

References gnash::plugin::ExternalInterface::convertNPVariant(), gnash::log_debug(), gnash::log_error(), gnash::plugin::ExternalInterface::makeInvoke(), gnash::plugin::ExternalInterface::makeString(), and writePlayer().

Referenced by gnash::SetVariableCallback().

§ writePlayer() [1/2]

int gnash::GnashPluginScriptObject::writePlayer ( const std::string &  data)

§ writePlayer() [2/2]

int gnash::GnashPluginScriptObject::writePlayer ( int  fd,
const std::string &  data 
)

References gnash::amf::write().

Member Data Documentation

§ _npclass

NPClass gnash::GnashPluginScriptObject::_npclass
static

§ nppinstance

NPP gnash::GnashPluginScriptObject::nppinstance

Plugin instance object.

Referenced by gnash::plugin::ExternalInterface::parseXML().


The documentation for this class was generated from the following files: