diff options
author | rekado <rekado@elephly.net> | 2016-09-20 21:53:08 +0200 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2016-09-20 22:11:46 +0200 |
commit | af660e60fc8160cace416e144fb6f817ee74b7d4 (patch) | |
tree | a412d4f5e2c97ff958d8ea55889e68a39f8642f3 /lisp | |
parent | 9261c64e6830cb9a661f83b59be986d2eab41765 (diff) |
WIP: Webkit add zoom.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/xwidget.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index ba05a161ae..0892030246 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -42,6 +42,7 @@ (declare-function xwidget-resize "xwidget.c" (xwidget new-width new-height)) (declare-function xwidget-webkit-execute-script "xwidget.c" (xwidget script)) (declare-function xwidget-webkit-goto-uri "xwidget.c" (xwidget uri)) +(declare-function xwidget-webkit-zoom "xwidget.c" (xwidget factor)) (declare-function xwidget-plist "xwidget.c" (xwidget)) (declare-function set-xwidget-plist "xwidget.c" (xwidget plist)) (declare-function xwidget-view-window "xwidget.c" (xwidget-view)) @@ -106,6 +107,8 @@ Interactively, URL defaults to the string looking like a url around point." (define-key map "t" (lambda () (interactive) (message "o"))) ;FIXME: ?!? (define-key map "\C-m" 'xwidget-webkit-insert-string) (define-key map "w" 'xwidget-webkit-current-url) + (define-key map "+" 'xwidget-webkit-zoom-in) + (define-key map "-" 'xwidget-webkit-zoom-out) ;;similar to image mode bindings (define-key map (kbd "SPC") 'xwidget-webkit-scroll-up) @@ -131,6 +134,16 @@ Interactively, URL defaults to the string looking like a url around point." map) "Keymap for `xwidget-webkit-mode'.") +(defun xwidget-webkit-zoom-in () + "Increase webkit view zoom factor." + (interactive) + (xwidget-webkit-zoom (xwidget-webkit-current-session) 0.1)) + +(defun xwidget-webkit-zoom-out () + "Decrease webkit view zoom factor." + (interactive) + (xwidget-webkit-zoom (xwidget-webkit-current-session) -0.1)) + (defun xwidget-webkit-scroll-up () "Scroll webkit up." (interactive) |