** webkit related
*** TODO webkit support webkit signals
-*** TODO particularily document-load-finished
+
+**** DONE particularily document-load-finished
+ CLOSED: [2011-08-01 Mon 22:34]
http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-document-load-finished
+because one might need tell set a title and sizes and things when it loads.
+**** TODO event bug
+Debugger entered--Lisp error: (error "Two bases given in one event")
+
+for some reason hapens sometimes with xwidget events.
+
*** TODO console messages
http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-console-message
http://getfirebug.com/wiki/index.php/Console_API#console.count.28.5Btitle.5D.29
prints hello to stdout but theres no way to catch stdout from webkit I
think other than receiving the signal.
-*** DONE webkit flashkiller by default
- CLOSED: [2011-07-19 Tue 14:27]
+*** TODO webkit flashkiller by default
while its possible to support plugins in the webkit xwidget, flash has
issues on 64 bit, and slows down emacs to a halt with off screen
rendering, and of course is not free software. its in the way for real
simply use this api:
http://webkitgtk.org/reference/WebKitWebPluginDatabase.html
+theres an implementation now but it's not robust enough webkit often
+crashes taking emacs with it.
+
*** TODO webkit downloads
when clicking a download link in Webkit Emacs should take over and handle it
from there. Probably need signals. There are Emacs libraries to
have a look at how docview solves it
webkit_web_view_search_text ()
*** TODO webkit relative references doesn't work
-probably because we handle scrolling in a non-standard way
+probably because we handle scrolling in a non-standard way. It does
+work sort of when theres a html frameset and webkit scrols by itself.
*** TODO webkit width adjustment handling issue
since there are so many levels of clipping and whatnot in xwidgets
sizing issues are difficult.
- xwidget-webkit-adjust-size
- xwidget-webkit-adjust-size-to-content
-and then try resizing Epiphany.
+and then compare by resizing in Epiphany, which is also webkit based.
*** TODO xwidget webkit allow loading from string from emacs
-*** TODO xwidget-webkit-last-session
+*** DONE xwidget-webkit-last-session
+ CLOSED: [2011-08-01 Mon 22:38]
was rather hurried. end result is that the lisp layer only really
allows for one webkit session.
*** TODO C-X b in other buffer from webkit
bafflingly resets the webkit view to the top. Maybe the window
reconfiguration hook code? further mystification is added because it
only seems to happen with ido mode enabled.
+
+in comparison with image-mode which does the right thing, I discovered
+that image-mode has special code to handle scrolling. the browser mode
+and image mode has some similarities.
+
+** TODO xwidget image display spec compatibility
+some history: the first version of the xwidget display spec was
+the same as an image spec. This turned out not to be fantastic because
+an xwidget is both like a process and like an image. it has a separate
+existence from display. So now the xwidget display spec is just a
+pointer to a xwidget. But then some useful functionality in Emacs
+can't be reused for xwidget, in particular image-mode.
+
+Maybe a new image type could be added that was a wraper on an
+xwidget. Then image mode could be reused for webkit mode.
+
** socket related
*** TODO some flickering during redisplay of sockets
with gtk3 an size allocation workaround is used.
-** TODO xwidgets doesn't work during bootstrap all of a sudden
+** DONE xwidgets doesn't work during bootstrap all of a sudden
+ CLOSED: [2011-08-01 Mon 22:33]
might be some annoying local issues with my install because it is not
-reliably reproducible.
+reliably reproducible. (went away during merges)
** TODO low impact xwidget based image viewer
for instance to render SVG using webkit, or some other canvas.
so, webkit could be used to display the SVG. the display spec for
images would be used. multiple webkits would be used rather than
offscreen rendering, so it would be GTK2 compatible.
+**
* old notes from x_draw_xwidget_glyph_string
BUG it seems this method for some reason is called with bad s->x and s->y sometimes.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; webkit support
(require 'browse-url)
+(require 'image-mode)
;;;###autoload
(defun xwidget-webkit-browse-url (url &optional new-session)
"Ask xwidget-webkit to browse URL.
(define-key map "r" 'xwidget-webkit-reload )
(define-key map "\C-m" 'xwidget-webkit-insert-string)
(define-key map [xwidget-event] 'xwidget-webkit-event-handler)
+
+ ;;similar to image mode bindings
+ (define-key map (kbd "SPC") 'image-scroll-up)
+ (define-key map (kbd "DEL") 'image-scroll-down)
+
+ (define-key map [remap forward-char] (xwidget-image-mode-navigation-adaptor 'image-forward-hscroll))
+ (define-key map [remap backward-char] (xwidget-image-mode-navigation-adaptor 'image-backward-hscroll))
+ (define-key map [remap right-char] (xwidget-image-mode-navigation-adaptor 'image-forward-hscroll))
+ (define-key map [remap left-char] (xwidget-image-mode-navigation-adaptor 'image-backward-hscroll))
+ (define-key map [remap previous-line] (xwidget-image-mode-navigation-adaptor 'image-previous-line))
+ (define-key map [remap next-line] (xwidget-image-mode-navigation-adaptor 'image-next-line))
+ (define-key map [remap scroll-up] (xwidget-image-mode-navigation-adaptor 'image-scroll-up))
+ (define-key map [remap scroll-up-command] (xwidget-image-mode-navigation-adaptor 'image-scroll-up))
+
+ (define-key map [remap scroll-down] (xwidget-image-mode-navigation-adaptor 'image-scroll-down))
+
+ (define-key map [remap scroll-down-command] (xwidget-image-mode-navigation-adaptor 'image-scroll-down))
+ (define-key map [remap move-beginning-of-line] (xwidget-image-mode-navigation-adaptor 'image-bol))
+ (define-key map [remap move-end-of-line] (xwidget-image-mode-navigation-adaptor 'image-eol))
+ (define-key map [remap beginning-of-buffer] (xwidget-image-mode-navigation-adaptor 'image-bob))
+ (define-key map [remap end-of-buffer] (xwidget-image-mode-navigation-adaptor 'image-eob))
+
+
map)
"Keymap for `xwidget-webkit-mode'.")
+(defun xwidget-image-display-size (spec &optional pixels frame)
+ (let ((xwi (xwidget-info (xwidget-at 1))))
+ (cons (aref xwi 2)
+ (aref xwi 3))))
+
+(defmacro xwidget-image-mode-navigation-adaptor (fn)
+ `(lambda () (interactive)
+ (flet ((image-display-size (spec &optional pixels frame) (xwidget-image-display-size spec)))
+ (funcall ,fn))))
+ )
+
(defun xwidget-webkit-event-handler ()
(interactive)
(message "stuff happened to webkit xwidget %S" last-input-event)
(let*
((xwidget-event-type (nth 2 last-input-event))
(xwidget (nth 1 last-input-event)))
- (cond ( (eq xwidget-event-type 'document-load-finished)
- (message "webkit loaded %s" xwidget))
+ (cond ((eq xwidget-event-type 'document-load-finished)
+ (message "webkit loaded %s" xwidget)
+ (xwidget-webkit-adjust-size-to-content))
)))
(define-derived-mode xwidget-webkit-mode
special-mode "xwidget-webkit" "xwidget webkit view mode"
- (setq buffer-read-only t))
+ (setq buffer-read-only t)
+ ;; Keep track of [vh]scroll when switching buffers
+ (image-mode-setup-winprops)
+
+ )
(defvar xwidget-webkit-last-session-buffer nil)
;;this is a workaround because I cant find the right place to put it in C
(add-hook 'window-configuration-change-hook 'xwidget-cleanup)
+;;killflash is sadly not reliable yet.
(defvar xwidget-webkit-kill-flash-oneshot t)
(defun xwidget-webkit-kill-flash ()
;;you can only call this once or webkit crashes and takes emacs with it. odd.