summaryrefslogtreecommitdiff
path: root/devdocs/elisp/xwidgets.html
blob: ee76203cee731709e703f6a097e038d6239a59b5 (plain)
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
 <h3 class="section">Embedded Native Widgets</h3>    <p>Emacs is able to display native widgets, such as GTK+ WebKit widgets, in Emacs buffers when it was built with the necessary support libraries and is running on a graphical terminal. To test whether Emacs supports display of embedded widgets, check that the <code>xwidget-internal</code> feature is available (see <a href="named-features">Named Features</a>). </p> <p>To display an embedded widget in a buffer, you must first create an xwidget object, and then use that object as the display specifier in a <code>display</code> text or overlay property (see <a href="display-property">Display Property</a>). </p> <dl> <dt id="make-xwidget">Function: <strong>make-xwidget</strong> <em>type title width height arguments &amp;optional buffer</em>
</dt> <dd>
<p>This creates and returns an xwidget object. If <var>buffer</var> is omitted or <code>nil</code>, it defaults to the current buffer. If <var>buffer</var> names a buffer that doesn’t exist, it will be created. The <var>type</var> identifies the type of the xwidget component, it can be one of the following: </p> <dl compact> <dt><code>webkit</code></dt> <dd><p>The WebKit component. </p></dd> </dl> <p>The <var>width</var> and <var>height</var> arguments specify the widget size in pixels, and <var>title</var>, a string, specifies its title. </p>
</dd>
</dl> <dl> <dt id="xwidgetp">Function: <strong>xwidgetp</strong> <em>object</em>
</dt> <dd><p>This function returns <code>t</code> if <var>object</var> is an xwidget, <code>nil</code> otherwise. </p></dd>
</dl> <dl> <dt id="xwidget-plist">Function: <strong>xwidget-plist</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the property list of <var>xwidget</var>. </p></dd>
</dl> <dl> <dt id="set-xwidget-plist">Function: <strong>set-xwidget-plist</strong> <em>xwidget plist</em>
</dt> <dd><p>This function replaces the property list of <var>xwidget</var> with a new property list given by <var>plist</var>. </p></dd>
</dl> <dl> <dt id="xwidget-buffer">Function: <strong>xwidget-buffer</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the buffer of <var>xwidget</var>. </p></dd>
</dl> <dl> <dt id="get-buffer-xwidgets">Function: <strong>get-buffer-xwidgets</strong> <em>buffer</em>
</dt> <dd><p>This function returns a list of xwidget objects associated with the <var>buffer</var>, which can be specified as a buffer object or a name of an existing buffer, a string. The value is <code>nil</code> if <var>buffer</var> contains no xwidgets. </p></dd>
</dl> <dl> <dt id="xwidget-webkit-goto-uri">Function: <strong>xwidget-webkit-goto-uri</strong> <em>xwidget uri</em>
</dt> <dd><p>This function browses the specified <var>uri</var> in the given <var>xwidget</var>. The <var>uri</var> is a string that specifies the name of a file or a URL. </p></dd>
</dl> <dl> <dt id="xwidget-webkit-execute-script">Function: <strong>xwidget-webkit-execute-script</strong> <em>xwidget script</em>
</dt> <dd><p>This function causes the browser widget specified by <var>xwidget</var> to execute the specified JavaScript <code>script</code>. </p></dd>
</dl> <dl> <dt id="xwidget-webkit-execute-script-rv">Function: <strong>xwidget-webkit-execute-script-rv</strong> <em>xwidget script &amp;optional default</em>
</dt> <dd><p>This function executes the specified <var>script</var> like <code>xwidget-webkit-execute-script</code> does, but it also returns the script’s return value as a string. If <var>script</var> doesn’t return a value, this function returns <var>default</var>, or <code>nil</code> if <var>default</var> was omitted. </p></dd>
</dl> <dl> <dt id="xwidget-webkit-get-title">Function: <strong>xwidget-webkit-get-title</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the title of <var>xwidget</var> as a string. </p></dd>
</dl> <dl> <dt id="xwidget-resize">Function: <strong>xwidget-resize</strong> <em>xwidget width height</em>
</dt> <dd><p>This function resizes the specified <var>xwidget</var> to the size <var>width</var>x<var>height</var> pixels. </p></dd>
</dl> <dl> <dt id="xwidget-size-request">Function: <strong>xwidget-size-request</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the desired size of <var>xwidget</var> as a list of the form <code>(<var>width</var> <var>height</var>)</code>. The dimensions are in pixels. </p></dd>
</dl> <dl> <dt id="xwidget-info">Function: <strong>xwidget-info</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the attributes of <var>xwidget</var> as a vector of the form <code>[<var>type</var> <var>title</var> <var>width</var> <var>height</var>]</code>. The attributes are usually determined by <code>make-xwidget</code> when the xwidget is created. </p></dd>
</dl> <dl> <dt id="set-xwidget-query-on-exit-flag">Function: <strong>set-xwidget-query-on-exit-flag</strong> <em>xwidget flag</em>
</dt> <dd><p>This function allows you to arrange that Emacs will ask the user for confirmation before exiting or before killing a buffer that has <var>xwidget</var> associated with it. If <var>flag</var> is non-<code>nil</code>, Emacs will query the user, otherwise it will not. </p></dd>
</dl> <dl> <dt id="xwidget-query-on-exit-flag">Function: <strong>xwidget-query-on-exit-flag</strong> <em>xwidget</em>
</dt> <dd><p>This function returns the current setting of <var>xwidget</var>s query-on-exit flag, either <code>t</code> or <code>nil</code>. </p></dd>
</dl><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Xwidgets.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Xwidgets.html</a>
  </p>
</div>