📄 swfdecasobject.xml
字号:
<varlistentry><term><parameter>fun</parameter> :</term><listitem><simpara> constructor</simpara></listitem></varlistentry><varlistentry><term><parameter>n_args</parameter> :</term><listitem><simpara> number of arguments</simpara></listitem></varlistentry><varlistentry><term><parameter>args</parameter> :</term><listitem><simpara> arguments to pass to constructor</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-object-add" role="function"/>swfdec_as_object_add ()</title><indexterm><primary>swfdec_as_object_add</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_object_add (<link linkend="SwfdecAsObject">SwfdecAsObject</link> *object, <link linkend="SwfdecAsContext">SwfdecAsContext</link> *context, <link linkend="gsize">gsize</link> size);</programlisting><para>Takes over the reference to <parameter>object</parameter> for the garbage collector of <parameter>context</parameter>. The object may not already be part of a different context. The given <parameter>size</parameter> must have been allocated before with <link linkend="swfdec-as-context-use-mem"><function>swfdec_as_context_use_mem()</function></link>.Note that after <link linkend="swfdec-as-object-add"><function>swfdec_as_object_add()</function></link> the garbage collector might hold theonly reference to <parameter>object</parameter>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>object</parameter> :</term><listitem><simpara> <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link> to make garbage-collected</simpara></listitem></varlistentry><varlistentry><term><parameter>context</parameter> :</term><listitem><simpara> <link linkend="SwfdecAsContext"><type>SwfdecAsContext</type></link> that should manage the object</simpara></listitem></varlistentry><varlistentry><term><parameter>size</parameter> :</term><listitem><simpara> size the object currently uses</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-object-set-constructor" role="function"/>swfdec_as_object_set_constructor ()</title><indexterm><primary>swfdec_as_object_set_constructor</primary></indexterm><programlisting><link linkend="void">void</link> swfdec_as_object_set_constructor (<link linkend="SwfdecAsObject">SwfdecAsObject</link> *object, <link linkend="SwfdecAsObject">SwfdecAsObject</link> *construct);</programlisting><para>Sets the constructor variables for <parameter>object</parameter>. Most objects get these variables set automatically, but for objects you created yourself, you wantto call this function. This is essentially the same as the following scriptcode:<informalexample><programlisting> object.constructor = construct;object.__proto__ = construct.prototype; </programlisting></informalexample></para><para></para><variablelist role="params"><varlistentry><term><parameter>object</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>construct</parameter> :</term><listitem><simpara> the constructor of <parameter>object</parameter></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="SwfdecAsVariableFlag" role="enum"/>enum SwfdecAsVariableFlag</title><indexterm><primary>SwfdecAsVariableFlag</primary></indexterm><programlisting>typedef enum { SWFDEC_AS_VARIABLE_HIDDEN = (1 << 0), SWFDEC_AS_VARIABLE_PERMANENT = (1 << 1), SWFDEC_AS_VARIABLE_CONSTANT = (1 << 2), SWFDEC_AS_VARIABLE_VERSION_6_UP = (1 << 7), SWFDEC_AS_VARIABLE_VERSION_NOT_6 = (1 << 8), SWFDEC_AS_VARIABLE_VERSION_7_UP = (1 << 10), SWFDEC_AS_VARIABLE_VERSION_8_UP = (1 << 12),} SwfdecAsVariableFlag;</programlisting><para>These flags are used to describe various properties of a variable insideSwfdec. You can manually set them with <link linkend="swfdec-as-object-set-variable-flags"><function>swfdec_as_object_set_variable_flags()</function></link>.</para><para></para><variablelist role="enum"><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-HIDDEN:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_HIDDEN</literal></term><listitem><simpara> Do not include variable in enumerations and <link linkend="swfdec-as-object-foreach"><function>swfdec_as_object_foreach()</function></link>.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-PERMANENT:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_PERMANENT</literal></term><listitem><simpara> Do not all <link linkend="swfdec-as-object-delete-variable"><function>swfdec_as_object_delete_variable()</function></link> to delete this variable.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-CONSTANT:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_CONSTANT</literal></term><listitem><simpara> Do not allow changing the value with <link linkend="swfdec-as-object-set-variable"><function>swfdec_as_object_set_variable()</function></link>.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-VERSION-6-UP:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_VERSION_6_UP</literal></term><listitem><simpara> This symbol is only visible in version 6 and above.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-VERSION-NOT-6:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_VERSION_NOT_6</literal></term><listitem><simpara> This symbols is visible in all versions but version 6.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-VERSION-7-UP:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_VERSION_7_UP</literal></term><listitem><simpara> This symbol is only visible in version 7 and above.</simpara></listitem></varlistentry><varlistentry><term><anchor id="SWFDEC-AS-VARIABLE-VERSION-8-UP:CAPS" role="constant"/><literal>SWFDEC_AS_VARIABLE_VERSION_8_UP</literal></term><listitem><simpara> This symbol is only visible in version 8 and above.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-object-get-variable" role="macro"/>swfdec_as_object_get_variable()</title><indexterm><primary>swfdec_as_object_get_variable</primary></indexterm><programlisting>#define swfdec_as_object_get_variable(object, variable, value)</programlisting><para>Gets the value of the given <parameter>variable</parameter> on <parameter>object</parameter>. It walks the prototype chain. This is a shortcut macro for <link linkend="swfdec-as-object-get-variable-and-flags"><function>swfdec_as_object_get_variable_and_flags()</function></link>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>object</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>variable</parameter> :</term><listitem><simpara> a garbage-collected string containing the name of the variable</simpara></listitem></varlistentry><varlistentry><term><parameter>value</parameter> :</term><listitem><simpara> pointer to a <link linkend="SwfdecAsValue"><type>SwfdecAsValue</type></link> that takes the return value or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-object-get-variable-and-flags" role="function"/>swfdec_as_object_get_variable_and_flags ()</title><indexterm><primary>swfdec_as_object_get_variable_and_flags</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> swfdec_as_object_get_variable_and_flags (<link linkend="SwfdecAsObject">SwfdecAsObject</link> *object, const <link linkend="char">char</link> *variable, <link linkend="SwfdecAsValue">SwfdecAsValue</link> *value, <link linkend="guint">guint</link> *flags, <link linkend="SwfdecAsObject">SwfdecAsObject</link> **pobject);</programlisting><para>Looks up <parameter>variable</parameter> on <parameter>object</parameter>. It also walks the object's prototype chain.If the variable exists, its value, flags and the real object containing thevariable will be set and <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> will be returned.</para><para></para><variablelist role="params"><varlistentry><term><parameter>object</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>variable</parameter> :</term><listitem><simpara> a garbage-collected string containing the name of the variable</simpara></listitem></varlistentry><varlistentry><term><parameter>value</parameter> :</term><listitem><simpara> pointer to a <link linkend="SwfdecAsValue"><type>SwfdecAsValue</type></link> that takes the return value or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>flags</parameter> :</term><listitem><simpara> pointer to a guint taking the variable's flags or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><parameter>pobject</parameter> :</term><listitem><simpara> pointer to set to the object that really holds the property or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the variable exists, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="swfdec-as-object-set-variable" role="macro"/>swfdec_as_object_set_variable()</title><indexterm><primary>swfdec_as_object_set_variable</primary></indexterm><programlisting>#define swfdec_as_object_set_variable(object, variable, value)</programlisting><para>Sets a variable on <parameter>object</parameter>. It is not guaranteed that getting the variableafter setting it results in the same value. This is a mcaro that calls <link linkend="swfdec-as-object-set-variable-and-flags"><function>swfdec_as_object_set_variable_and_flags()</function></link></para><para></para><variablelist role="params"><varlistentry><term><parameter>object</parameter> :</term><listitem><simpara> a <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -