35 #ifndef GNASH_PLUGIN_SCRIPT_OBJECT_H
36 #define GNASH_PLUGIN_SCRIPT_OBJECT_H
43 #include "npruntime.h"
73 static bool marshalInvoke (NPObject *npobj, NPIdentifier name,
74 const NPVariant *args, uint32_t argCount,
77 uint32_t argCount, NPVariant *result);
82 const NPVariant *value);
87 uint32_t count, NPVariant *result);
113 bool SetVariable(
const std::string &name,
const NPVariant& value);
134 bool Invoke(NPObject *npobj, NPIdentifier name,
const NPVariant *args,
135 uint32_t argCount, NPVariant *result);
136 bool AddMethod(NPIdentifier name, NPInvokeFunctionPtr func);
137 void AddProperty(
const std::string &name,
const std::string &str);
138 void AddProperty(
const std::string &name,
double num);
139 void AddProperty(
const std::string &name,
int num);
150 bool GetProperty(NPIdentifier name, NPVariant *result);
151 bool SetProperty(NPIdentifier name,
const NPVariant& value);
153 bool Enumerate(NPIdentifier **identifier, uint32_t *count);
154 bool Construct(
const NPVariant *data, uint32_t argCount, NPVariant *result);
157 void initializeIdentifiers();
158 void setInstance(NPP inst) { _nppinstance = inst; };
163 std::map<NPIdentifier, GnashNPVariant> _properties;
164 std::map<NPIdentifier, NPInvokeFunctionPtr> _methods;
179 #endif // GNASH_PLUGIN_SCRIPT_OBJECT_H