mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Add xwidget support for macOS
Co-authored-by: Jaesup Kwak <veshboo@gmail.com>
* configure.ac: Allow '--with-xwidgets' for "${NS_IMPL_COCOA}".
* etc/NEWS: Mention new feature.
* etc/TODO: Remove done TODO to implement xwidget in NeXTstep port.
* lisp/xwidget.el (xwidget-webkit-clone-and-split-below)
(xwidget-webkit-clone-and-split-right): New procedures.
(xwidget-webkit-callback): Remove call to
'xwidget-webkit-adjust-size-to-window' as adjusting xwidget size is
handled in 'x_draw_xwidget_glyph_string'.
(xwidget-webkit-enable-plugins): New variable.
* nextstep/templates/Info.plist.in: Add 'NSAppTransportSecurity'.
* src/Makefile.in: Add nsxwidget.o for compilation.
* src/emacs.c (main): Move conditional call to 'syms_of_xwidget'.
* src/nsterm.m (ns_draw_glyph_string): Add case for 'XWIDGET_GLYPH'.
(note_mouse_movement mouseMoved): Make it easy to resize window by
dragging mode-line or vertical separator adjacent to large glyph.
* src/nsxwidget.h src/nsxwidget.m: Newly added files, xwidget webkit
backend for macOS Cocoa.
* src/xwidget.c (Fmake_xwidget, xwidget_init_view)
(x_draw_xwidget_glyph_string, xwidget_is_web_view)
(Fxwidget_webkit_goto_uri, Fxwidget_webkit_zoom, Fxwidget_resize)
(Fxwidget_size_request, Fdelete_xwidget_view, xwidget_end_redisplay)
(kill_buffer_xwidgets): Add macOS Cocoa specific functions and code
with 'NS_IMPL_COCOA' and guard GTK specific functions and code with
'USE_GTK'.
(x_draw_xwidget_glyph_string): Handle adjusting xwidget size.
* src/xwidget.h (xwidget, xwidget_view): Add macOS Cocoa specific
fields with 'NS_IMPL_COCOA' and guard GTK specific fields with
USE_GTK.
This commit is contained in:
parent
38d70f79a6
commit
d089c4fbfc
11 changed files with 935 additions and 35 deletions
|
|
@ -99,6 +99,24 @@ Interactively, URL defaults to the string looking like a url around point."
|
|||
(xwidget-webkit-new-session url)
|
||||
(xwidget-webkit-goto-url url))))
|
||||
|
||||
(defun xwidget-webkit-clone-and-split-below ()
|
||||
"Clone current URL into a new widget place in new window below.
|
||||
Get the URL of current session, then browse to the URL
|
||||
in `split-window-below' with a new xwidget webkit session."
|
||||
(interactive)
|
||||
(let ((url (xwidget-webkit-current-url)))
|
||||
(with-selected-window (split-window-below)
|
||||
(xwidget-webkit-new-session url))))
|
||||
|
||||
(defun xwidget-webkit-clone-and-split-right ()
|
||||
"Clone current URL into a new widget place in new window right.
|
||||
Get the URL of current session, then browse to the URL
|
||||
in `split-window-right' with a new xwidget webkit session."
|
||||
(interactive)
|
||||
(let ((url (xwidget-webkit-current-url)))
|
||||
(with-selected-window (split-window-right)
|
||||
(xwidget-webkit-new-session url))))
|
||||
|
||||
;;todo.
|
||||
;; - check that the webkit support is compiled in
|
||||
(defvar xwidget-webkit-mode-map
|
||||
|
|
@ -222,9 +240,9 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget."
|
|||
xwidget "document.title"
|
||||
(lambda (title)
|
||||
(xwidget-log "webkit finished loading: '%s'" title)
|
||||
;;TODO - check the native/internal scroll
|
||||
;;(xwidget-adjust-size-to-content xwidget)
|
||||
(xwidget-webkit-adjust-size-to-window xwidget)
|
||||
;; Do not adjust webkit size to window here, the
|
||||
;; selected window can be the mini-buffer window
|
||||
;; unwantedly.
|
||||
(rename-buffer (format "*xwidget webkit: %s *" title))))
|
||||
(pop-to-buffer (current-buffer)))
|
||||
((eq xwidget-event-type 'decide-policy)
|
||||
|
|
@ -240,6 +258,11 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget."
|
|||
(t (xwidget-log "unhandled event:%s" xwidget-event-type))))))
|
||||
|
||||
(defvar bookmark-make-record-function)
|
||||
(when (memq window-system '(mac ns))
|
||||
(defvar xwidget-webkit-enable-plugins nil
|
||||
"Enable plugins for xwidget webkit.
|
||||
If non-nil, plugins are enabled. Otherwise, disabled."))
|
||||
|
||||
(define-derived-mode xwidget-webkit-mode
|
||||
special-mode "xwidget-webkit" "Xwidget webkit view mode."
|
||||
(setq buffer-read-only t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue