📄 swfdecascontext.xml
字号:
<varlistentry><term><parameter>bytes</parameter> :</term><listitem><simpara> number of bytes to use</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the memory could be allocated. <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on OOM.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-gc" role="function"/>swfdec_as_context_gc ()</title><indexterm><primary>swfdec_as_context_gc</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_gc (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context);</programlisting><para>Calls the Swfdec Gargbage collector and reclaims any unused memory. You should call this function or <link linkend="swfdec-as-context-maybe-gc"><function>swfdec_as_context_maybe_gc()</function></link> regularly.<warning>Calling the GC during execution of code or initialization is not allowed.</warning></para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-maybe-gc" role="function"/>swfdec_as_context_maybe_gc ()</title><indexterm><primary>swfdec_as_context_maybe_gc</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_maybe_gc (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context);</programlisting><para>Calls the garbage collector if necessary. It's a good idea to call thisfunction regularly instead of <link linkend="swfdec-as-context-gc"><function>swfdec_as_context_gc()</function></link> as it only does collectgarage as needed. For example, <link linkend="SwfdecPlayer"><type>SwfdecPlayer</type></link> calls this function after everyframe advancement.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-run" role="function"/>swfdec_as_context_run ()</title><indexterm><primary>swfdec_as_context_run</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_run (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context);</programlisting><para>Continues running the script engine. Executing code in this engine worksin 2 steps: First, you push the frame to be executed onto the stack, thenyou call this function to execute it. So this function is the single entrypoint to script execution. This might be helpful when debugging your application. <note>A lot of convenience functions like <link linkend="swfdec-as-object-run"><function>swfdec_as_object_run()</function></link> call this function automatically.</note></para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-unuse-mem" role="function"/>swfdec_as_context_unuse_mem ()</title><indexterm><primary>swfdec_as_context_unuse_mem</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_unuse_mem (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context, <link linkend="gsize">gsize</link> bytes);</programlisting><para>Releases a number of bytes previously allocated using <link linkend="swfdec-as-context-use-mem"><function>swfdec_as_context_use_mem()</function></link>. See that function for details.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>bytes</parameter> :</term><listitem><simpara> number of bytes to release</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-eval" role="function"/>swfdec_as_context_eval ()</title><indexterm><primary>swfdec_as_context_eval</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_eval (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context, <link linkend="SwfdecAsObject">SwfdecAsObject</link> *obj, const <link linkend="char">char</link> *str, <link linkend="SwfdecAsValue">SwfdecAsValue</link> *val);</programlisting><para>This function works like the Actionscript eval function used on <parameter>obj</parameter>.It handles both slash-style and dot-style notation. If an error occuredduring evaluation, the return value will be the undefined value.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>obj</parameter> :</term><listitem><simpara> <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link> to use as source for evaluating or NULL for the current frame's scope</simpara></listitem></varlistentry><varlistentry><term><parameter>str</parameter> :</term><listitem><simpara> The string to evaluate</simpara></listitem></varlistentry><varlistentry><term><parameter>val</parameter> :</term><listitem><simpara> location for the return value</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-eval-set" role="function"/>swfdec_as_context_eval_set ()</title><indexterm><primary>swfdec_as_context_eval_set</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_eval_set (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context, <link linkend="SwfdecAsObject">SwfdecAsObject</link> *obj, const <link linkend="char">char</link> *str, const <link linkend="SwfdecAsValue">SwfdecAsValue</link> *val);</programlisting><para>Sets the variable referenced by <parameter>str</parameter> to <parameter>val</parameter>. If <parameter>str</parameter> does not reference a valid property, nothing happens.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>obj</parameter> :</term><listitem><simpara> <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link> to use as source for evaluating or NULL for the default object.</simpara></listitem></varlistentry><varlistentry><term><parameter>str</parameter> :</term><listitem><simpara> The string to evaluate</simpara></listitem></varlistentry><varlistentry><term><parameter>val</parameter> :</term><listitem><simpara> the value to set the variable to</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-get-time" role="function"/>swfdec_as_context_get_time ()</title><indexterm><primary>swfdec_as_context_get_time</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_context_get_time (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context, <link linkend="GTimeVal">GTimeVal</link> *tv);</programlisting><para>This function queries the time to be used inside this context. By default,this is the same as <link linkend="g-get-current-time"><function>g_get_current_time()</function></link>, but it may be overwriten to allowthings such as slower or faster playback.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>tv</parameter> :</term><listitem><simpara> a <link linkend="GTimeVal"><type>GTimeVal</type></link> to be set to the context's time</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-get-frame" role="function"/>swfdec_as_context_get_frame ()</title><indexterm><primary>swfdec_as_context_get_frame</primary></indexterm><programlisting><link linkend="SwfdecAsFrame">SwfdecAsFrame</link>* swfdec_as_context_get_frame (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context);</programlisting><para>This is a debugging function. It gets the topmost stack frame that is currently executing. If no function is executing, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned. You caneasily get a backtrace with code like this:<informalexample><programlisting>for (frame = swfdec_as_context_get_frame (context); frame != NULL; frame = swfdec_as_frame_get_next (frame)) { char *s = swfdec_as_object_get_debug (SWFDEC_AS_OBJECT (frame)); g_print ("%s\n", s); g_free (s);}</programlisting></informalexample></para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the currently executing frame or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-context-is-constructing" role="function"/>swfdec_as_context_is_constructing ()</title><indexterm><primary>swfdec_as_context_is_constructing</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> swfdec_as_context_is_constructing (<link linkend="SwfdecAsContext">SwfdecAsContext</link> *context);</programlisting><para>Determines if the contexxt is currently constructing. This information isused by various constructors to do different things when they are constructing and when they are not. The Boolean, Number and String functionsfor example setup the newly constructed objects when constructing but onlycast the provided argument when being called.</para><para></para><variablelist role="params"><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsConstruct"><type>SwfdecAsConstruct</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the currently executing frame is a constructor</simpara></listitem></varlistentry></variablelist></refsect2></refsect1><refsect1><title>See Also</title>SwfdecPlayer</refsect1><refsect1><refsect2 /><refsect2 /></refsect1></refentry>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -