/usr/share/gtk-doc/html/seed/Sandbox-module.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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sandbox</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="modules.html" title="Part IV. Seed Module Reference">
<link rel="prev" href="GtkBuilder-module.html" title="GtkBuilder">
<link rel="next" href="ix01.html" title="Index">
<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="GtkBuilder-module.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="modules.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="ix01.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="Sandbox-module"></a>Sandbox</h2></div>
<div><div class="author">
<h3 class="author">
<span class="firstname">Robert</span> <span class="surname">Carr</span>
</h3>
<div class="affiliation"><div class="address"><p><br>
<code class="email"><<a class="email" href="mailto:racarr@gnome.org">racarr@<em class="parameter"><code>gnome.org</code></em></a>></code><br>
</p></div></div>
</div></div>
</div></div>
<div class="refsect1">
<a name="idp6701488"></a><h2>API Reference</h2>
<p>
The sandbox module allows the creation of isolated JSCore contexts with individual global objects. It is useful as a literal "sandbox" or in a variety of other contexts.
</p>
<pre class="programlisting">
sandbox = imports.sandbox;
</pre>
<p>
</p>
<p>
</p>
<div class="refsect2">
<a name="sandbox-context"></a><h3>new sandbox.Context()</h3>
<p>Creates a new sandbox context object, which wraps a Seed JavaScript context with it's own global object. By default this global object contains only default JSCore globals (Array, Object, etc...) and has no ability to interact with the outside system. Note the context must be manually destroyed with the <em class="parameter"><code>destroy</code></em> method.</p>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="sandbox-eval"></a><h3>context.eval(source)</h3>
<p>Evaluates a string <em class="parameter"><code>source</code></em> with context, returns the result.</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em></span></p></td>
<td>undefined</td>
</tr></tbody>
</table></div>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="sandbox-addglobals"></a><h3>context.add_globals()</h3>
<p>Adds the default Seed globals to the context, including the 'Seed' global object, and the imports object.</p>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="sandbox-destroy"></a><h3>context.destroy()</h3>
<p>Destroys the internal context object, and any further usage of the wrapper is an exception</p>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="sandbox-global"></a><h3>context.global</h3>
<p>A project, representing the literal global object of the context, may be freely read from and assigned to</p>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="idp10155600"></a><h2>Examples</h2>
<p>Below are several examples of using the Seed Sandbox module. For additional resources, consult the examples/ folder of the Seed source</p>
<div class="example">
<a name="sandbox-example"></a><p class="title"><b>Example 17. </b></p>
<div class="example-contents"><pre class="programlisting">
sandbox = imports.sandbox;
ctx = new sandbox.Context();
ctx.eval("b = 2+2");
print(ctx.global.b); //4
ctx.global.b = new Gtk.Window(); // Possible to expose objects to the context.
ctx.eval("b.show()");
</pre></div>
</div>
<br class="example-break">
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|