From 9cf59535dc1e9cc37237a7ddfefd164a444a2470 Mon Sep 17 00:00:00 2001 From: portix Date: Tue, 20 Nov 2012 12:35:32 +0100 Subject: Implementing wv.toPng; set base-uri to HOME in sp_load --- api/dwb-js.7 | 40 ++++++++++++++++++++++++++++++++++++++-- api/jsapi.7.txt | 17 +++++++++++++++++ api/jsapi.txt | 25 +++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/dwb-js.7 b/api/dwb-js.7 index aed9715e..0994d865 100644 --- a/api/dwb-js.7 +++ b/api/dwb-js.7 @@ -2,12 +2,12 @@ .\" Title: dwb-js .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.77.1 -.\" Date: 11/19/2012 +.\" Date: 11/20/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "DWB\-JS" "7" "11/19/2012" "\ \&" "\ \&" +.TH "DWB\-JS" "7" "11/20/2012" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1296,6 +1296,42 @@ true if the uri is loaded .nr an-break-flag 1 .br .ps +1 +\fBNumber wv.toPng(String filename, [Number width, Number height], [Boolean keepAspect])\fR +.RS 4 +.sp +Renders a webview to a png file\&. +.PP +\fIfilename\fR +.RS 4 +The filename for the png\&. +.RE +.PP +\fIwidth\fR +.RS 4 +The width of the png, if width is < 0 and height is > 0 the image has the same aspect ratio as the original webview, optional\&. +.RE +.PP +\fIheight\fR +.RS 4 +The height of the png, if height is < 0 and width is > 0 the image will have the same aspect ratio as the original webview, optional, mandatory if width is set\&. +.RE +.PP +\fIkeepAspect\fR +.RS 4 +Whether to keep the aspect ratio, if set to true the new image will have the same aspect ratio as the original webview, width and height are taken as maximum sizes and must both be > 0, optional\&. +.RE +.PP +\fIreturns\fR +.RS 4 +A cairo_status_t (0 on success) or \-1 if an error occured\&. +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 \fBvoid wv.reload(void)\fR .RS 4 .sp diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt index 0bfa830f..10330aef 100644 --- a/api/jsapi.7.txt +++ b/api/jsapi.7.txt @@ -598,6 +598,23 @@ changes, return true to stop the emission, optional _returns_;; true if the uri is loaded **** +==== Number wv.toPng(String filename, [Number width, Number height], [Boolean keepAspect]) +**** + +Renders a webview to a png file. + +_filename_;; The filename for the png. +_width_;; The width of the png, if width is < 0 and height is > 0 the image has +the same aspect ratio as the original webview, optional. +_height_;; The height of the png, if height is < 0 and width is > 0 the image +will have the same aspect ratio as the original webview, optional, mandatory +if width is set. +_keepAspect_;; Whether to keep the aspect ratio, if set to true the new +image will have the same aspect ratio as the original webview, width and +height are taken as maximum sizes and must both be > 0, optional. +_returns_;; A cairo_status_t (0 on success) or -1 if an error occured. +**** + ==== void wv.reload(void) **** diff --git a/api/jsapi.txt b/api/jsapi.txt index 67007c5f..7ea7f182 100644 --- a/api/jsapi.txt +++ b/api/jsapi.txt @@ -1175,6 +1175,31 @@ void wv.reload(void) Reload a webview **** +**** +[float] +==== *toPng()* ==== + +[source,javascript] +---- +Number wv.toPng(String filename, [Number width, Number height], [Boolean keepAspect]) +---- + +Renders a webview to a png file. + +_filename_;; The filename for the png. +_width_;; The width of the png, if width is < 0 and height is > 0 the image has +the same aspect ratio as the original webview, optional. +_height_;; The height of the png, if height is < 0 and width is > 0 the image +will have the same aspect ratio as the original webview, optional, mandatory +if width is set. +_keepAspect_;; Whether to keep the ascpect ratio, if the set to true the new +image will have the same aspect ratio as the original webview, width and +height are taken as maximum sizes and must both be > 0, optional. +_returns_;; A cairo_status_t (0 on success) or -1 if an error occured. +**** + + + ==== [float] -- cgit v1.2.3