Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions

gnash::GnashPluginScriptObject Class Reference

#include <pluginScriptObject.h>

List of all members.

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)
bool createPipe ()
bool closePipe ()
bool closePipe (int fd)
bool checkPipe ()
bool checkPipe (int fd)
int getReadFD ()
GIOChannel * getReadChannel ()
int getWriteFD ()
GIOChannel * getWriteChannel ()
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)

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)
bool handleInvoke (GIOChannel *iochan, GIOCondition cond)
bool processPlayerRequest (gchar *buf, gsize len)
 Process a null-terminated request line.

Constructor & Destructor Documentation

gnash::GnashPluginScriptObject::GnashPluginScriptObject (  ) 

Referenced by marshalAllocate().

gnash::GnashPluginScriptObject::GnashPluginScriptObject ( NPP  npp  ) 
gnash::GnashPluginScriptObject::~GnashPluginScriptObject (  ) 

Member Function Documentation

bool gnash::GnashPluginScriptObject::AddMethod ( NPIdentifier  name,
NPInvokeFunctionPtr  func 
)
void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
const std::string &  str 
)
void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
double  num 
)
void gnash::GnashPluginScriptObject::AddProperty ( const std::string &  name,
int  num 
)
bool gnash::GnashPluginScriptObject::checkPipe (  ) 

References WRITEFD.

bool gnash::GnashPluginScriptObject::checkPipe ( int  fd  ) 

References errno.

bool gnash::GnashPluginScriptObject::closePipe (  ) 

References READFD, and WRITEFD.

Referenced by gnash::nsPluginInstance::shut().

bool gnash::GnashPluginScriptObject::closePipe ( int  fd  ) 
bool gnash::GnashPluginScriptObject::Construct ( const NPVariant *  data,
uint32_t  argCount,
NPVariant *  result 
) [protected]

References __PRETTY_FUNCTION__.

Referenced by marshalConstruct().

bool gnash::GnashPluginScriptObject::createPipe (  ) 
void gnash::GnashPluginScriptObject::Deallocate (  )  [protected]
bool gnash::GnashPluginScriptObject::Enumerate ( NPIdentifier **  identifier,
uint32_t *  count 
) [protected]

References __PRETTY_FUNCTION__.

Referenced by marshalEnumerate().

int gnash::GnashPluginScriptObject::getControlFD (  ) 
int gnash::GnashPluginScriptObject::getHostFD (  ) 
bool gnash::GnashPluginScriptObject::GetProperty ( NPIdentifier  name,
NPVariant *  result 
) [protected]
GIOChannel* gnash::GnashPluginScriptObject::getReadChannel (  )  [inline]
int gnash::GnashPluginScriptObject::getReadFD (  )  [inline]
GnashNPVariant gnash::GnashPluginScriptObject::GetVariable ( const std::string &  name  ) 

Get the value of a variable from the standalone player

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

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

GIOChannel* gnash::GnashPluginScriptObject::getWriteChannel (  )  [inline]
int gnash::GnashPluginScriptObject::getWriteFD (  )  [inline]
bool gnash::GnashPluginScriptObject::handleInvoke ( GIOChannel *  iochan,
GIOCondition  cond 
) [protected]
bool gnash::GnashPluginScriptObject::HasMethod ( NPIdentifier  name  )  [protected]
bool gnash::GnashPluginScriptObject::HasProperty ( NPIdentifier  name  )  [protected]
void gnash::GnashPluginScriptObject::Invalidate (  )  [protected]
bool gnash::GnashPluginScriptObject::Invoke ( NPObject *  npobj,
NPIdentifier  name,
const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
)
bool gnash::GnashPluginScriptObject::InvokeDefault ( const NPVariant *  args,
uint32_t  argCount,
NPVariant *  result 
) [protected]
NPObject * gnash::GnashPluginScriptObject::marshalAllocate ( NPP  npp,
NPClass *  aClass 
) [static]
bool gnash::GnashPluginScriptObject::marshalConstruct ( NPObject *  npobj,
const NPVariant *  data,
uint32_t  count,
NPVariant *  result 
) [static]

References __PRETTY_FUNCTION__, and Construct().

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

References NPN_MemFree().

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

References __PRETTY_FUNCTION__, and Enumerate().

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

References GetProperty().

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

References HasProperty().

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

References Invoke().

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

References InvokeDefault().

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

References RemoveProperty().

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

References SetProperty().

bool gnash::GnashPluginScriptObject::processPlayerRequest ( gchar *  buf,
gsize  len 
) [protected]

Process a null-terminated request line.

Parameters:
buf The single request. Caller is responsible for memory management, but give us permission to modify the string.
len Lenght of buffer.
Returns:
true if the request was processed, false otherwise (bogus request..)

References __PRETTY_FUNCTION__.

Referenced by handleInvoke().

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

Referenced by GetVariable().

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

References FIONREAD.

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

Referenced by marshalRemoveProperty().

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.

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.

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

Referenced by AddProperty(), and marshalSetProperty().

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

Set a variable in the standalone player

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

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

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

Referenced by closePipe(), GetVariable(), and SetVariable().

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

References gnash::amf::write().


Member Data Documentation


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