<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="SwfdecPlayerScripting">
<refmeta>
<refentrytitle role="top_of_page" id="SwfdecPlayerScripting.top_of_page">SwfdecPlayerScripting</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>SWFDEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>SwfdecPlayerScripting</refname>
<refpurpose>integration with external scripts</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="SwfdecPlayerScripting.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;swfdec/swfdec.h&gt;

                    <link linkend="SwfdecPlayerScripting-struct">SwfdecPlayerScripting</link>;
                    <link linkend="SwfdecPlayerScriptingClass">SwfdecPlayerScriptingClass</link>;
</synopsis>
</refsynopsisdiv>

<refsect1 id="SwfdecPlayerScripting.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----SwfdecPlayerScripting
</synopsis>

</refsect1>








<refsect1 id="SwfdecPlayerScripting.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <parameter>SwfdecPlayerScripting</parameter> object is used to implement the ExternalInterface
object inside Flash. By providing your own custom implementation of this 
object using <link linkend="swfdec-player-set-scripting"><function>swfdec_player_set_scripting()</function></link>, you can allow a Flash file to 
call your own custom functions. And you can call functions inside the Flash 
player.
</para>
<para>
The functions are emitted using a custom XML format. The same format is used
to call functions in the Flash player. FIXME: describe the XML format in use.</para>
<para>

</para>
</refsect1>

<refsect1 id="SwfdecPlayerScripting.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="SwfdecPlayerScripting-struct" role="struct">
<title>SwfdecPlayerScripting</title>
<indexterm zone="SwfdecPlayerScripting-struct"><primary>SwfdecPlayerScripting</primary></indexterm><programlisting>typedef struct _SwfdecPlayerScripting SwfdecPlayerScripting;</programlisting>
<para>
The object you have to create.</para>
<para>

</para></refsect2>
<refsect2 id="SwfdecPlayerScriptingClass" role="struct">
<title>SwfdecPlayerScriptingClass</title>
<indexterm zone="SwfdecPlayerScriptingClass"><primary>SwfdecPlayerScriptingClass</primary></indexterm><programlisting>typedef struct {
  char *		(* js_get_id)	(SwfdecPlayerScripting *scripting,
					 SwfdecPlayer *		player);
  char *		(* js_call)	(SwfdecPlayerScripting *scripting,
					 SwfdecPlayer *         player,
					 const char *		code);
  char *		(* xml_call)	(SwfdecPlayerScripting *scripting,
					 SwfdecPlayer *         player,
					 const char *		xml);
} SwfdecPlayerScriptingClass;
</programlisting>
<para>
You have to implement the virtual functions in this object to get a working
scripting implementation.</para>
<para>

</para><variablelist role="struct">
<varlistentry>
<term><structfield>js_get_id</structfield>&nbsp;()</term>
<listitem><simpara> optional function. Returns the string by which the scripting 
            object can reference itself in calls to the <parameter>js_call</parameter> function.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>js_call</structfield>&nbsp;()</term>
<listitem><simpara> optional function. Emits Javascript code that you have to 
          interpret. You must also implement the <parameter>js_get_id</parameter> function to make
          this function work. The return value must be in the custom XML 
          format.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>xml_call</structfield>&nbsp;()</term>
<listitem><simpara> optional function. If the Javascript functions aren't implemented,
           an xml format is used to encode the function call and the call is
           then done using this function. The return value is to be provided
           in the same custom XML format.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
