/usr/share/gtk-doc/html/seed/seed-JavaScript-Classes.html is in seed-doc 3.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Creating JavaScript classes</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Seed Reference Manual">
<link rel="up" href="api.html" title="Part III. Seed API Reference">
<link rel="prev" href="seed-Native-Functions.html" title="Creating native functions">
<link rel="next" href="seed-SeedClosure.html" title="Using JavaScript closures">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="seed-Native-Functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="api.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Seed Reference Manual</th>
<td><a accesskey="n" href="seed-SeedClosure.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#seed-JavaScript-Classes.synopsis" class="shortcut">Top</a>
|
<a href="#seed-JavaScript-Classes.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="seed-JavaScript-Classes"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="seed-JavaScript-Classes.top_of_page"></a>Creating JavaScript classes</span></h2>
<p>Creating JavaScript classes — Dealing with Seed class definitions and constructors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="seed-JavaScript-Classes.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <seed/seed.h>
enum <a class="link" href="seed-JavaScript-Classes.html#SeedPropertyAttributes" title="enum SeedPropertyAttributes">SeedPropertyAttributes</a>;
enum <a class="link" href="seed-JavaScript-Classes.html#SeedClassAttributes" title="enum SeedClassAttributes">SeedClassAttributes</a>;
typedef <a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass">SeedClass</a>;
#define <a class="link" href="seed-JavaScript-Classes.html#seed-empty-class" title="seed_empty_class">seed_empty_class</a>
<a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass"><span class="returnvalue">SeedClass</span></a> <a class="link" href="seed-JavaScript-Classes.html#seed-create-class" title="seed_create_class ()">seed_create_class</a> (<em class="parameter"><code><span class="type">seed_class_definition</span> *def</code></em>);
<a class="link" href="seed-JS-Objects.html#SeedObject" title="SeedObject"><span class="returnvalue">SeedObject</span></a> <a class="link" href="seed-JavaScript-Classes.html#seed-make-constructor" title="seed_make_constructor ()">seed_make_constructor</a> (<em class="parameter"><code><a class="link" href="seed-Contexts.html#SeedContext" title="SeedContext"><span class="type">SeedContext</span></a> ctx</code></em>,
<em class="parameter"><code><a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass"><span class="type">SeedClass</span></a> klass</code></em>,
<em class="parameter"><code><a class="link" href="seed-JS-Objects.html#SeedObjectCallAsConstructorCallback" title="SeedObjectCallAsConstructorCallback ()"><span class="type">SeedObjectCallAsConstructorCallback</span></a> constructor</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="seed-JavaScript-Classes.description"></a><h2>Description</h2>
<p>
Defining new Seed classes allows for implementing more complex
behavior than possible with the traditional JavaScript object system
and default class.
When writing Seed modules, it is often the best pattern to define many
of your types through classes and static functions/value.
Please note that inside the finalize callback of a class, it is not
legal to call any method requiring a <a class="link" href="seed-Contexts.html#SeedContext" title="SeedContext"><span class="type">SeedContext</span></a> (with the exception
of protect/unprotect, though it is not guaranteed this will continue
to work with future versions of JSCore).
</p>
</div>
<div class="refsect1">
<a name="seed-JavaScript-Classes.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SeedPropertyAttributes"></a><h3>enum SeedPropertyAttributes</h3>
<pre class="programlisting">typedef enum {
SEED_PROPERTY_ATTRIBUTE_NONE = 0,
SEED_PROPERTY_ATTRIBUTE_READ_ONLY = 1 << 1,
SEED_PROPERTY_ATTRIBUTE_DONT_ENUM = 1 << 2,
SEED_PROPERTY_ATTRIBUTE_DONT_DELETE = 1 << 3
} SeedPropertyAttributes;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="SeedClassAttributes"></a><h3>enum SeedClassAttributes</h3>
<pre class="programlisting">typedef enum {
SEED_CLASS_ATTRIBUTE_NONE = 0,
SEED_CLASS_ATTRIBUTE_NO_SHARED_PROTOTYPE = 1 << 1
} SeedClassAttributes;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="SeedClass"></a><h3>SeedClass</h3>
<pre class="programlisting">typedef gpointer SeedClass;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="seed-empty-class"></a><h3>seed_empty_class</h3>
<pre class="programlisting">#define seed_empty_class { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="seed-create-class"></a><h3>seed_create_class ()</h3>
<pre class="programlisting"><a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass"><span class="returnvalue">SeedClass</span></a> seed_create_class (<em class="parameter"><code><span class="type">seed_class_definition</span> *def</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>def</code></em> :</span></p></td>
<td>A <span class="type">JSClassDefinition</span>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass"><span class="type">SeedClass</span></a>, described by <em class="parameter"><code>def</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="seed-make-constructor"></a><h3>seed_make_constructor ()</h3>
<pre class="programlisting"><a class="link" href="seed-JS-Objects.html#SeedObject" title="SeedObject"><span class="returnvalue">SeedObject</span></a> seed_make_constructor (<em class="parameter"><code><a class="link" href="seed-Contexts.html#SeedContext" title="SeedContext"><span class="type">SeedContext</span></a> ctx</code></em>,
<em class="parameter"><code><a class="link" href="seed-JavaScript-Classes.html#SeedClass" title="SeedClass"><span class="type">SeedClass</span></a> klass</code></em>,
<em class="parameter"><code><a class="link" href="seed-JS-Objects.html#SeedObjectCallAsConstructorCallback" title="SeedObjectCallAsConstructorCallback ()"><span class="type">SeedObjectCallAsConstructorCallback</span></a> constructor</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>ctx</code></em> :</span></p></td>
<td>A <a class="link" href="seed-Contexts.html#SeedContext" title="SeedContext"><span class="type">SeedContext</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>constructor</code></em> :</span></p></td>
<td>The <span class="type">JSObjectCallAsConstructorCallback</span> function to call when
the constructor is invoked with 'new'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a class="link" href="seed-JS-Objects.html#SeedObject" title="SeedObject"><span class="type">SeedObject</span></a>, which is a constructor function.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|