The @var{width} and @var{height} arguments specify the widget size in
pixels, and @var{title}, a string, specifies its title. @var{related}
-is used internally by the WebKit widget, and is not of interest to the
-programmer.
+is used internally by the WebKit widget, and specifies another WebKit
+widget that the newly created widget should share settings and
+subprocesses with.
@end defun
@defun xwidgetp object
'[menu-bar foo-bar]'. This further improves backwards-compatibility
when converting menus to use 'easy-menu-define'.
++++
+** The function `make-xwidget' now accepts an optional RELATED argument.
+This argument is used as another widget for the newly created WebKit
+widget to share settings and subprocesses with. It must be another
+WebKit widget.
+
+++
** New function `xwidget-perform-lispy-event'.
This function allows you to send events to xwidgets. Usually, some
(require 'bookmark)
(declare-function make-xwidget "xwidget.c"
- (type title width height arguments &optional buffer))
+ (type title width height arguments &optional buffer related))
(declare-function xwidget-buffer "xwidget.c" (xwidget))
(declare-function set-xwidget-buffer "xwidget.c" (xwidget buffer))
(declare-function xwidget-size-request "xwidget.c" (xwidget))
"Displaying native widgets in Emacs buffers."
:group 'widgets)
-(defun xwidget-insert (pos type title width height &optional args)
+(defun xwidget-insert (pos type title width height &optional args related)
"Insert an xwidget at position POS.
-Supply the xwidget's TYPE, TITLE, WIDTH, and HEIGHT.
+Supply the xwidget's TYPE, TITLE, WIDTH, HEIGHT, and RELATED.
See `make-xwidget' for the possible TYPE values.
The usage of optional argument ARGS depends on the xwidget.
This returns the result of `make-xwidget'."
(goto-char pos)
- (let ((id (make-xwidget type title width height args)))
+ (let ((id (make-xwidget type title width height args nil related)))
(put-text-property (point) (+ 1 (point))
'display (list 'xwidget ':xwidget id))
id))
(let*
((bufname (generate-new-buffer-name "*xwidget-webkit*"))
(callback (or callback #'xwidget-webkit-callback))
+ (current-session (xwidget-webkit-current-session))
xw)
(setq xwidget-webkit-last-session-buffer (switch-to-buffer
(get-buffer-create bufname)))
(setq xw (xwidget-insert
start 'webkit bufname
(xwidget-window-inside-pixel-width (selected-window))
- (xwidget-window-inside-pixel-height (selected-window)))))
+ (xwidget-window-inside-pixel-height (selected-window))
+ nil current-session)))
(xwidget-put xw 'callback callback)
(xwidget-webkit-mode)
(xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)))
- webkit
-RELATED is nil, or an xwidget. This argument is used internally.
+RELATED is nil, or an xwidget. When constructing a WebKit widget, it
+will share the same settings and internal subprocess as RELATED.
Returns the newly constructed xwidget, or nil if construction
fails. */)
(Lisp_Object type,