#include <pluginScriptObject.h>
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. |
gnash::GnashPluginScriptObject::GnashPluginScriptObject | ( | ) |
Referenced by marshalAllocate().
gnash::GnashPluginScriptObject::GnashPluginScriptObject | ( | NPP | npp | ) |
gnash::GnashPluginScriptObject::~GnashPluginScriptObject | ( | ) |
bool gnash::GnashPluginScriptObject::AddMethod | ( | NPIdentifier | name, | |
NPInvokeFunctionPtr | func | |||
) |
void gnash::GnashPluginScriptObject::AddProperty | ( | const std::string & | name, | |
const std::string & | str | |||
) |
References NPN_GetStringIdentifier(), and SetProperty().
void gnash::GnashPluginScriptObject::AddProperty | ( | const std::string & | name, | |
double | num | |||
) |
References NPN_GetStringIdentifier(), and SetProperty().
void gnash::GnashPluginScriptObject::AddProperty | ( | const std::string & | name, | |
int | num | |||
) |
References NPN_GetStringIdentifier(), and SetProperty().
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 | ) |
References ogl::close(), gnash::ExternalInterface::makeInvoke(), and writePlayer().
bool gnash::GnashPluginScriptObject::Construct | ( | const NPVariant * | data, | |
uint32_t | argCount, | |||
NPVariant * | result | |||
) | [protected] |
References __PRETTY_FUNCTION__.
Referenced by marshalConstruct().
bool gnash::GnashPluginScriptObject::createPipe | ( | ) |
References __PRETTY_FUNCTION__, errno, READFD, and WRITEFD.
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] |
References gnash::GnashNPVariant::copy().
Referenced by marshalGetProperty().
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
name | the name of the variable to set |
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] |
References __PRETTY_FUNCTION__, and processPlayerRequest().
bool gnash::GnashPluginScriptObject::HasMethod | ( | NPIdentifier | name | ) | [protected] |
Referenced by marshalHasMethod().
bool gnash::GnashPluginScriptObject::HasProperty | ( | NPIdentifier | name | ) | [protected] |
Referenced by marshalHasProperty().
void gnash::GnashPluginScriptObject::Invalidate | ( | ) | [protected] |
bool gnash::GnashPluginScriptObject::Invoke | ( | NPObject * | npobj, | |
NPIdentifier | name, | |||
const NPVariant * | args, | |||
uint32_t | argCount, | |||
NPVariant * | result | |||
) |
Referenced by marshalInvoke().
bool gnash::GnashPluginScriptObject::InvokeDefault | ( | const NPVariant * | args, | |
uint32_t | argCount, | |||
NPVariant * | result | |||
) | [protected] |
References __PRETTY_FUNCTION__, and name.
Referenced by marshalInvokeDefault().
NPObject * gnash::GnashPluginScriptObject::marshalAllocate | ( | NPP | npp, | |
NPClass * | aClass | |||
) | [static] |
References GnashPluginScriptObject(), and NPN_MemAlloc().
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] |
Referenced by gnash::nsPluginInstance::nsPluginInstance().
bool gnash::GnashPluginScriptObject::marshalGetProperty | ( | NPObject * | npobj, | |
NPIdentifier | name, | |||
NPVariant * | result | |||
) | [static] |
References GetProperty().
bool gnash::GnashPluginScriptObject::marshalHasMethod | ( | NPObject * | npobj, | |
NPIdentifier | name | |||
) | [static] |
References HasMethod().
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.
buf | The single request. Caller is responsible for memory management, but give us permission to modify the string. | |
len | Lenght of buffer. |
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
name | the name of the variable to set | |
value | the value to set the variable to |
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().
NPClass gnash::GnashPluginScriptObject::_npclass [static] |