Gnash  0.8.11dev
callbacks.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 //
18 
19 #ifndef GNASH_PLUGIN_CALLBACKS_H
20 #define GNASH_PLUGIN_CALLBACKS_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include "npapi.h"
27 #include "npruntime.h"
28 
29 // Support the methods listed in
30 // http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html
31 
57 
58 namespace gnash {
59 
79 extern bool GetVariableCallback (NPObject *npobj, NPIdentifier name,
80  const NPVariant *args, uint32_t argCount,
81  NPVariant *result);
82 
103 extern bool SetVariableCallback (NPObject *npobj, NPIdentifier name,
104  const NPVariant *args, uint32_t argCount,
105  NPVariant *result);
106 
124 extern bool GotoFrame (NPObject *npobj, NPIdentifier name,
125  const NPVariant *args, uint32_t argCount,
126  NPVariant *result);
127 
143 extern bool IsPlaying (NPObject *npobj, NPIdentifier name,
144  const NPVariant *args, uint32_t argCount,
145  NPVariant *result);
146 
165 extern bool LoadMovie (NPObject *npobj, NPIdentifier name,
166  const NPVariant *args, uint32_t argCount,
167  NPVariant *result);
168 
190 extern bool Pan (NPObject *npobj, NPIdentifier name,
191  const NPVariant *args, uint32_t argCount,
192  NPVariant *result);
193 
211 extern bool PercentLoaded (NPObject *npobj, NPIdentifier name,
212  const NPVariant *args, uint32_t argCount,
213  NPVariant *result);
214 
222 extern bool Play (NPObject *npobj, NPIdentifier name,
223  const NPVariant *args, uint32_t argCount,
224  NPVariant *result);
225 
233 extern bool Rewind (NPObject *npobj, NPIdentifier name,
234  const NPVariant *args, uint32_t argCount,
235  NPVariant *result);
236 
249 extern bool SetZoomRect (NPObject *npobj, NPIdentifier name,
250  const NPVariant *args, uint32_t argCount,
251  NPVariant *result);
252 
260 extern bool StopPlay (NPObject *npobj, NPIdentifier name,
261  const NPVariant *args, uint32_t argCount,
262  NPVariant *result);
263 
273 extern bool Zoom (NPObject *npobj, NPIdentifier name,
274  const NPVariant *args, uint32_t argCount,
275  NPVariant *result);
276 
286 extern bool TotalFrames (NPObject *npobj, NPIdentifier name,
287  const NPVariant *args, uint32_t argCount,
288  NPVariant *result);
289 
290 extern bool remoteCallback (NPObject *npobj, NPIdentifier name,
291  const NPVariant *args, uint32_t argCount,
292  NPVariant *result);
293 
294 #endif // GNASH_PLUGIN_CALLBACKS_H
295 
296 } // end of gnash namespace
297 
298 // local Variables:
299 // mode: C++
300 // indent-tabs-mode: nil
301 // End:
NPN_UTF8FromIdentifier
NPUTF8 * NPN_UTF8FromIdentifier(NPIdentifier identifier)
Definition: gshell.cpp:209
gnash::NPStringToString
std::string NPStringToString(const NPString &str)
Construct a std::string from an NPString.
Definition: GnashNPVariant.h:87
gnash::SetZoomRect
bool SetZoomRect(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:481
name
std::string name
Definition: LocalConnection_as.cpp:149
gnash::remoteCallback
bool remoteCallback(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:655
gnash::TotalFrames
bool TotalFrames(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:605
gnash::PercentLoaded
bool PercentLoaded(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:351
gnash::GnashPluginScriptObject::readPlayer
std::string readPlayer()
Definition: pluginScriptObject.cpp:684
external.h
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::LoadMovie
bool LoadMovie(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:260
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::GnashPluginScriptObject::SetVariable
bool SetVariable(const std::string &name, const NPVariant &value)
Definition: pluginScriptObject.cpp:563
gnash::Rewind
bool Rewind(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:439
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::SetVariableCallback
bool SetVariableCallback(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:99
gnash::GnashNPVariant::get
const NPVariant & get() const
Obtain a reference to the contained NPVariant.
Definition: GnashNPVariant.h:162
gnash::Pan
bool Pan(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:308
gnash::Zoom
bool Zoom(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:566
pluginScriptObject.h
gnash::GnashNPVariant
This class holds ownership of (a copy of) an NPVariant.
Definition: GnashNPVariant.h:116
NPN_IntFromIdentifier
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
Definition: gshell.cpp:215
__PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__
Definition: log.h:444
gnash::plugin::ExternalInterface::convertNPVariant
static std::string convertNPVariant(const NPVariant *npv)
Definition: external.cpp:369
plugin.h
gnash::plugin::ExternalInterface::parseXML
static GnashNPVariant parseXML(GnashPluginScriptObject *scriptobj, const std::string &xml)
Definition: external.cpp:266
gnash::IsPlaying
bool IsPlaying(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:207
gnash::GnashPluginScriptObject::GetVariable
GnashNPVariant GetVariable(const std::string &name)
Definition: pluginScriptObject.cpp:591
gnash::StopPlay
bool StopPlay(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:526
gnash::GotoFrame
bool GotoFrame(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:166
gnashconfig.h
gnash::Play
bool Play(NPObject *npobj, NPIdentifier, const NPVariant *, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:401
gnash::GetVariableCallback
bool GetVariableCallback(NPObject *npobj, NPIdentifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
Definition: callbacks.cpp:132
gnash::GnashPluginScriptObject::writePlayer
int writePlayer(const std::string &data)
Definition: pluginScriptObject.cpp:664
gnash::GnashNPVariant::copy
void copy(NPVariant &dest) const
Copy the contained NPVariant into another NPVariant.
Definition: GnashNPVariant.h:152
gnash::GnashPluginScriptObject
Definition: pluginScriptObject.h:58
gnash::SimpleBuffer::empty
bool empty() const
Return true if buffer is empty.
Definition: SimpleBuffer.h:72
data
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
NPN_IdentifierIsString
bool NPN_IdentifierIsString(NPIdentifier identifier)
Definition: gshell.cpp:507
gnash::plugin::ExternalInterface::makeInvoke
static std::string makeInvoke(const std::string &method, std::vector< std::string > args)
Definition: external.cpp:43