diff options
| author | Eli Zaretskii | 2016-01-30 10:04:13 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-01-30 10:04:13 +0200 |
| commit | ef760b899ad89f941f552ed2d3ac9e45156f3e3c (patch) | |
| tree | 51655888833ded2b5f1b91a69e42381defd19959 | |
| parent | 05f1f0dbb80a46e54865bdd30400bdc708cad7a3 (diff) | |
| download | emacs-ef760b899ad89f941f552ed2d3ac9e45156f3e3c.tar.gz emacs-ef760b899ad89f941f552ed2d3ac9e45156f3e3c.zip | |
Document xwidget commands and functions
* doc/lispref/display.texi (Xwidgets): New section, describes some
of the xwidget primitives.
* doc/lispref/display.texi (Display): Update the chapter menu.
* doc/emacs/misc.texi (Embedded WebKit Widgets): New section.
* doc/emacs/emacs.texi (Top): Update the master menu to include
the xwidget node.
| -rw-r--r-- | doc/emacs/emacs.texi | 1 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 22 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 113 | ||||
| -rw-r--r-- | etc/NEWS | 12 |
4 files changed, 143 insertions, 5 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index ac8988b4020..dc99d493241 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -192,6 +192,7 @@ Advanced Features | |||
| 192 | * Network Security:: Managing the network security. | 192 | * Network Security:: Managing the network security. |
| 193 | * Document View:: Viewing PDF, PS and DVI files. | 193 | * Document View:: Viewing PDF, PS and DVI files. |
| 194 | * EWW:: A web browser in Emacs. | 194 | * EWW:: A web browser in Emacs. |
| 195 | * Embedded WebKit Widgets:: Embedding browser widgets in Emacs buffers. | ||
| 195 | * Shell:: Executing shell commands from Emacs. | 196 | * Shell:: Executing shell commands from Emacs. |
| 196 | * Emacs Server:: Using Emacs as an editing server. | 197 | * Emacs Server:: Using Emacs as an editing server. |
| 197 | * Printing:: Printing hardcopies of buffers or regions. | 198 | * Printing:: Printing hardcopies of buffers or regions. |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 2d8137e832f..b5a21500fcb 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -604,6 +604,28 @@ using the command @kbd{M-x eww-open-file}. You can use EWW as the | |||
| 604 | web browser for @code{browse-url}, @pxref{Browse-URL}. For full | 604 | web browser for @code{browse-url}, @pxref{Browse-URL}. For full |
| 605 | details, @pxref{Top, EWW,, eww, The Emacs Web Wowser Manual}. | 605 | details, @pxref{Top, EWW,, eww, The Emacs Web Wowser Manual}. |
| 606 | 606 | ||
| 607 | @node Embedded WebKit Widgets | ||
| 608 | @section Embedded WebKit Widgets | ||
| 609 | @cindex xwidget | ||
| 610 | @cindex webkit widgets | ||
| 611 | @cindex embedded widgets | ||
| 612 | |||
| 613 | @findex xwidget-webkit-browse-url | ||
| 614 | @findex xwidget-webkit-mode | ||
| 615 | @cindex Xwidget-WebKit mode | ||
| 616 | If Emacs was compiled with the appropriate support packages, it is | ||
| 617 | able to show browser widgets in its buffers. The command @kbd{M-x | ||
| 618 | xwidget-webkit-browse-url} asks for a URL to display in the browser | ||
| 619 | widget. The URL normally defaults to the URL at or before point, but | ||
| 620 | if there is an active region (@pxref{Mark}), the default URL comes | ||
| 621 | from the region instead, after removing any whitespace from it. The | ||
| 622 | command then creates a new buffer with the embedded browser showing | ||
| 623 | the specified URL. The buffer is put in the Xwidget-WebKit mode | ||
| 624 | (similar to Image mode, @pxref{File Conveniences}), which provides | ||
| 625 | one-key commands for scrolling the widget, changing its size, and | ||
| 626 | reloading it. Type @w{@kbd{C-h b}} in that buffer to see the key | ||
| 627 | bindings. | ||
| 628 | |||
| 607 | @node Shell | 629 | @node Shell |
| 608 | @section Running Shell Commands from Emacs | 630 | @section Running Shell Commands from Emacs |
| 609 | @cindex subshell | 631 | @cindex subshell |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index eaba03d5739..aa98ed40ee5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -27,6 +27,7 @@ that Emacs presents to the user. | |||
| 27 | * Window Dividers:: Separating windows visually. | 27 | * Window Dividers:: Separating windows visually. |
| 28 | * Display Property:: Enabling special display features. | 28 | * Display Property:: Enabling special display features. |
| 29 | * Images:: Displaying images in Emacs buffers. | 29 | * Images:: Displaying images in Emacs buffers. |
| 30 | * Xwidgets:: Displaying native widgets in Emacs buffers. | ||
| 30 | * Buttons:: Adding clickable buttons to Emacs buffers. | 31 | * Buttons:: Adding clickable buttons to Emacs buffers. |
| 31 | * Abstract Display:: Emacs's Widget for Object Collections. | 32 | * Abstract Display:: Emacs's Widget for Object Collections. |
| 32 | * Blinking:: How Emacs shows the matching open parenthesis. | 33 | * Blinking:: How Emacs shows the matching open parenthesis. |
| @@ -5612,6 +5613,118 @@ except when you explicitly clear it. This mode can be useful for | |||
| 5612 | debugging. | 5613 | debugging. |
| 5613 | @end defvar | 5614 | @end defvar |
| 5614 | 5615 | ||
| 5616 | @node Xwidgets | ||
| 5617 | @section Embedded Native Widgets | ||
| 5618 | @cindex xwidget | ||
| 5619 | @cindex embedded widgets | ||
| 5620 | @cindex webkit browser widget | ||
| 5621 | |||
| 5622 | Emacs is able to display native widgets, such as GTK WebKit widgets, | ||
| 5623 | in Emacs buffers when it was built with the necessary support | ||
| 5624 | libraries and is running on a graphical terminal. To test whether | ||
| 5625 | Emacs supports display of embedded widgets, check that the | ||
| 5626 | @code{xwidget-internal} feature is available (@pxref{Named Features}). | ||
| 5627 | |||
| 5628 | To display an embedded widget in a buffer, you must first create an | ||
| 5629 | xwidget object, and then use that object as the display specifier | ||
| 5630 | in a @code{display} text or overlay property (@pxref{Display | ||
| 5631 | Property}). | ||
| 5632 | |||
| 5633 | @defun make-xwidget beg end type title width height arguments &optional buffer | ||
| 5634 | This creates an xwidget object between @var{beg} and @var{end}, buffer | ||
| 5635 | positions in @var{buffer}, and returns the new object. If | ||
| 5636 | @var{buffer} is omitted or @code{nil}, it defaults to the current | ||
| 5637 | buffer. If @var{buffer} names a buffer that doesn't exist, it will be | ||
| 5638 | created. The @var{type} identifies the type of the xwidget component, | ||
| 5639 | it can be one of the following: | ||
| 5640 | |||
| 5641 | @table @code | ||
| 5642 | @item webkit-osr | ||
| 5643 | The WebKit OSR (@dfn{on-stack replacement}) component. | ||
| 5644 | @end table | ||
| 5645 | |||
| 5646 | The @var{width} and @var{height} arguments specify the widget size in | ||
| 5647 | pixels, and @var{title}, a string, specifies its title. | ||
| 5648 | @end defun | ||
| 5649 | |||
| 5650 | @defun xwidgetp object | ||
| 5651 | This function returns @code{t} if @var{object} is an xwidget, | ||
| 5652 | @code{nil} otherwise. | ||
| 5653 | @end defun | ||
| 5654 | |||
| 5655 | @defun xwidget-plist xwidget | ||
| 5656 | This function returns the property list of @var{xwidget}. | ||
| 5657 | @end defun | ||
| 5658 | |||
| 5659 | @defun set-xwidget-plist xwidget plist | ||
| 5660 | This function replaces the property list of @var{xwidget} with a new | ||
| 5661 | property list given by @var{plist}. | ||
| 5662 | @end defun | ||
| 5663 | |||
| 5664 | @defun xwidget-buffer xwidget | ||
| 5665 | This function returns the buffer of @var{xwidget}. | ||
| 5666 | @end defun | ||
| 5667 | |||
| 5668 | @defun get-buffer-xwidgets buffer | ||
| 5669 | This function returns a list of xwidget objects associated with the | ||
| 5670 | @var{buffer}, which can be specified as a buffer object or a name of | ||
| 5671 | an existing buffer, a string. The value is @code{nil} if @var{buffer} | ||
| 5672 | contains no xwidgets. | ||
| 5673 | @end defun | ||
| 5674 | |||
| 5675 | @defun xwidget-webkit-goto-uri xwidget uri | ||
| 5676 | This function browses the specified @var{uri} in the given | ||
| 5677 | @var{xwidget}. The @var{uri} is a string that specifies the name of a | ||
| 5678 | file or a URL. @c FIXME: What else can a URI specify in this context? | ||
| 5679 | @end defun | ||
| 5680 | |||
| 5681 | @defun xwidget-webkit-execute-script xwidget script | ||
| 5682 | This function causes the browser widget specified by @var{xwidget} to | ||
| 5683 | execute the specified JavaScript @code{script}. | ||
| 5684 | @end defun | ||
| 5685 | |||
| 5686 | @defun xwidget-webkit-execute-script-rv xwidget script &optional default | ||
| 5687 | This function executes the specified @var{script} like | ||
| 5688 | @code{xwidget-webkit-execute-script} does, but it also returns the | ||
| 5689 | script's return value as a string. If @var{script} doesn't return a | ||
| 5690 | value, this function returns @var{default}, or @code{nil} if | ||
| 5691 | @var{default} was omitted. | ||
| 5692 | @end defun | ||
| 5693 | |||
| 5694 | @defun xwidget-webkit-get-title xwidget | ||
| 5695 | This function returns the title of @var{xwidget} as a string. | ||
| 5696 | @end defun | ||
| 5697 | |||
| 5698 | @defun xwidget-resize xwidget width height | ||
| 5699 | This function resizes the specified @var{xwidget} to the size | ||
| 5700 | @var{width}x@var{height} pixels. | ||
| 5701 | @end defun | ||
| 5702 | |||
| 5703 | @defun xwidget-size-request xwidget | ||
| 5704 | This function returns the desired size of @var{xwidget} as a list of | ||
| 5705 | the form @code{(@var{width} @var{height})}. The dimensions are in | ||
| 5706 | pixels. | ||
| 5707 | @end defun | ||
| 5708 | |||
| 5709 | @defun xwidget-info xwidget | ||
| 5710 | This function returns the attributes of @var{xwidget} as a vector of | ||
| 5711 | the form @code{[@var{type} @var{title} @var{width} @var{height}]}. | ||
| 5712 | The attributes are usually determined by @code{make-xwidget} when the | ||
| 5713 | xwidget is created. | ||
| 5714 | @end defun | ||
| 5715 | |||
| 5716 | @defun set-xwidget-query-on-exit-flag xwidget flag | ||
| 5717 | This function allows you to arrange that Emacs will ask the user for | ||
| 5718 | confirmation before exiting or before killing a buffer that has | ||
| 5719 | @var{xwidget} associated with it. If @var{flag} is non-@code{nil}, | ||
| 5720 | Emacs will query the user, otherwise it will not. | ||
| 5721 | @end defun | ||
| 5722 | |||
| 5723 | @defun xwidget-query-on-exit-flag xwidget | ||
| 5724 | This function returns the current setting of @var{xwidget}s | ||
| 5725 | query-on-exit flag, either @code{t} or @code{nil}. | ||
| 5726 | @end defun | ||
| 5727 | |||
| 5615 | @node Buttons | 5728 | @node Buttons |
| 5616 | @section Buttons | 5729 | @section Buttons |
| 5617 | @cindex buttons in buffers | 5730 | @cindex buttons in buffers |
| @@ -126,13 +126,15 @@ and can contain escape sequences for command keys, quotes, and the like. | |||
| 126 | 126 | ||
| 127 | * Changes in Emacs 25.1 | 127 | * Changes in Emacs 25.1 |
| 128 | 128 | ||
| 129 | +++ | ||
| 129 | ** Xwidgets: a new feature for embedding native widgets inside Emacs buffers. | 130 | ** Xwidgets: a new feature for embedding native widgets inside Emacs buffers. |
| 130 | If you have gtk3 and webkitgtk3 installed, you can access the | 131 | If you have gtk3 and webkitgtk3 installed, and Emacs was built with |
| 131 | embedded webkit browser with `M-x xwidget-webkit-browse-url'. This | 132 | xwidget support, you can access the embedded webkit browser with `M-x |
| 132 | opens a new buffer with the embedded browser. The buffer will | 133 | xwidget-webkit-browse-url'. This opens a new buffer with the embedded |
| 133 | have a new mode, `xwidget-webkit-mode' (similar to `image-mode'), | 134 | browser. The buffer will have a new mode, `xwidget-webkit-mode' |
| 134 | which supports the webkit widget. | 135 | (similar to `image-mode'), which supports the webkit widget. |
| 135 | 136 | ||
| 137 | +++ | ||
| 136 | *** New functions for xwidget-webkit mode `xwidget-webkit-insert-string', | 138 | *** New functions for xwidget-webkit mode `xwidget-webkit-insert-string', |
| 137 | `xwidget-webkit-adjust-size-dispatch', `xwidget-webkit-back', | 139 | `xwidget-webkit-adjust-size-dispatch', `xwidget-webkit-back', |
| 138 | `xwidget-webkit-browse-url', `xwidget-webkit-reload', | 140 | `xwidget-webkit-browse-url', `xwidget-webkit-reload', |