Webkit status (updated)
Phil Longstaff
plongstaff at rogers.com
Mon Mar 30 11:33:08 EDT 2009
That's higher up in the s/w stack. I'm just looking at the end, where html is passed in to the engine.
Phil
________________________________
From: Chris Dennis <cgdennis at btinternet.com>
To: Phil Longstaff <plongstaff at rogers.com>; Gnucash list <gnucash-devel at lists.gnucash.org>
Sent: Monday, March 30, 2009 11:30:19 AM
Subject: Re: Webkit status (updated)
Phil Longstaff wrote:
> The basic flow is that in the C code, the report engine asks the html code to show a uri such as "report:id=3". The html code sees the uri type "report" and calls the report engine back to supply it with html. The report engine then returns a string with the html code. I don't know why gnc-document gets in there.
Because on the Guile side, most reports use calls to gnc:html-document-add-object! and a host of other such functions that build up a gnc-document -- a complex 'object' (probably a 'record' in Guile-speak) that later gets converted into HTML. Reports using eguile-gnc just create the HTML, and currently have to convert it to a gnc-document so that the correct type of data is returned by the report function. My patch below by-passes the conversion from HTML to gnc-document and back again.
cheers
Chris
>
> Phil
>
> ------------------------------------------------------------------------
> *From:* Chris Dennis <cgdennis at btinternet.com>
> *To:* Phil Longstaff <plongstaff at rogers.com>
> *Cc:* Gnucash list <gnucash-devel at lists.gnucash.org>
> *Sent:* Monday, March 30, 2009 3:00:16 AM
> *Subject:* Re: Webkit status (updated)
>
> Phil Longstaff wrote:
> > So, at this point, with libwebkit-1.0-1 and libwebkit-dev installed (on kubuntu), I can replace use of gtkhtml by webkit.
> Excellent!
>
> Would it also be possible to include the option for a report to return a simple HTML string rather than a gnc document? My new-fangled eguile-based reports (see http://bugzilla.gnome.org/show_bug.cgi?id=574582) create such an HTML string, and then convert it to a gnc document, and then it gets converted straight back again.
>
> In fact I think all that is required to achieve this is the following patch (which I've edited to avoid wrapping, but you get the gist):
>
> Index: report.scm
> ===================================================================
> --- report.scm (revision 18001)
> +++ report.scm (working copy)
> @@ -633,8 +633,11 @@
> (stylesheet (gnc:report-stylesheet report))
> (doc (renderer report))
> (html #f))
> - (gnc:html-document-set-style-sheet! doc stylesheet)
> - (set! html (gnc:html-document-render doc headers?))
> + (if (string? doc)
> + (set! html doc)
> + (begin
> + (gnc:html-document-set-style-sheet! doc stylesheet)
> + (set! html (gnc:html-document-render doc headers?))))
> (gnc:report-set-ctext! report html) ;; cache the html
> (gnc:report-set-dirty?! report #f) ;; mark it clean
> html)
>
> cheers
>
> Chris
> -- Chris Dennis cgdennis at btinternet.com <mailto:cgdennis at btinternet.com>
> Fordingbridge, Hampshire, UK
-- Chris Dennis cgdennis at btinternet.com
Fordingbridge, Hampshire, UK
More information about the gnucash-devel
mailing list