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 /src | |
parent | 9261c64e6830cb9a661f83b59be986d2eab41765 (diff) |
WIP: Webkit add zoom.
Diffstat (limited to 'src')
-rw-r--r-- | src/xwidget.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 8e6b47507b..a098150b40 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -539,6 +539,25 @@ DEFUN ("xwidget-webkit-goto-uri", return Qnil; } +DEFUN ("xwidget-webkit-zoom", + Fxwidget_webkit_zoom, Sxwidget_webkit_zoom, + 2, 2, 0, + doc: /* Change the zoom factor of the xwidget webkit instance +referenced by XWIDGET. */) + (Lisp_Object xwidget, Lisp_Object factor) +{ + WEBKIT_FN_INIT (); + if (FLOATP (factor)) + { + double zoom_change = XFLOAT_DATA (factor); + webkit_web_view_set_zoom_level + (WEBKIT_WEB_VIEW (xw->widget_osr), + webkit_web_view_get_zoom_level + (WEBKIT_WEB_VIEW (xw->widget_osr)) + zoom_change); + } + return Qnil; +} + DEFUN ("xwidget-webkit-execute-script", Fxwidget_webkit_execute_script, Sxwidget_webkit_execute_script, @@ -823,6 +842,7 @@ syms_of_xwidget (void) defsubr (&Sset_xwidget_query_on_exit_flag); defsubr (&Sxwidget_webkit_goto_uri); + defsubr (&Sxwidget_webkit_zoom); defsubr (&Sxwidget_webkit_execute_script); defsubr (&Sxwidget_webkit_get_title); DEFSYM (Qwebkit, "webkit"); |