From 5093a8fb141e4df3bf2fad3b7757047b992d1693 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 4 Jun 2018 11:01:23 +0800 Subject: [PATCH] [webkit] eradicate gtkhtml in .scm This commit does away with anything gtkhtml related. Some variables eg css? must remain because they're used later on. --- .../business-reports/balsheet-eg.eguile.scm | 7 - .../report/business-reports/balsheet-eg.scm | 13 +- gnucash/report/business-reports/receipt.scm | 16 +- .../report/business-reports/taxinvoice.scm | 16 +- gnucash/report/locale-specific/us/taxtxf.scm | 86 +-------- .../report/report-system/html-document.scm | 6 +- .../report/stylesheets/stylesheet-easy.scm | 179 ++++++------------ .../report/stylesheets/stylesheet-fancy.scm | 179 ++++++------------ .../report/stylesheets/stylesheet-footer.scm | 179 ++++++------------ .../stylesheets/stylesheet-head-or-tail.scm | 179 ++++++------------ .../report/stylesheets/stylesheet-plain.scm | 179 ++++++------------ 11 files changed, 282 insertions(+), 757 deletions(-) diff --git a/gnucash/report/business-reports/balsheet-eg.eguile.scm b/gnucash/report/business-reports/balsheet-eg.eguile.scm index 1bcec52bf3..c7a91f18ee 100644 --- a/gnucash/report/business-reports/balsheet-eg.eguile.scm +++ b/gnucash/report/business-reports/balsheet-eg.eguile.scm @@ -153,9 +153,6 @@ - -
-

@@ -314,10 +311,6 @@

- -

- - diff --git a/gnucash/report/business-reports/balsheet-eg.scm b/gnucash/report/business-reports/balsheet-eg.scm index d5717a937d..d1b5cf2ae5 100644 --- a/gnucash/report/business-reports/balsheet-eg.scm +++ b/gnucash/report/business-reports/balsheet-eg.scm @@ -433,8 +433,6 @@ ;; XXX I haven't found a way to get the book for which the report was opened here (coyname (or (gnc:company-info (gnc-get-current-book) gnc:*company-name*) "")) - (css? (gnc-html-engine-supports-css)) - (html #f)) ;; end of all the lets. time for some real code @@ -458,8 +456,7 @@ (define (foreignstyle item) ;; apply styling for amount in foreign currency - (if css? - (string-append "" item "")) + (string-append "" item "") (string-append "" item "")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -671,13 +668,7 @@ (set! html (eguile-file-to-string opt-template-file (the-environment))) (gnc:debug "balsheet-eg.scm - generated html:") (gnc:debug html) (gnc:report-finished) - (if css? ; return report as document or html, depending on version - html - (let ((document (gnc:make-html-document))) - (gnc:html-document-add-object! document html) - document)) - - )) + html)) (gnc:define-report 'version 1 diff --git a/gnucash/report/business-reports/receipt.scm b/gnucash/report/business-reports/receipt.scm index 6ee7250e4a..9fb8614873 100644 --- a/gnucash/report/business-reports/receipt.scm +++ b/gnucash/report/business-reports/receipt.scm @@ -240,22 +240,14 @@ (opt-amount-due-heading (opt-value headingpage2 optname-amount-due)) (opt-payment-recd-heading (opt-value headingpage2 optname-payment-recd)) (opt-extra-notes (opt-value notespage optname-extra-notes)) - (css? #t) ;(and (defined? 'gnc-html-engine-supports-css) (gnc-html-engine-supports-css))) - (html #f)) - - (set! html (eguile-file-to-string + (css? #t) + (html (eguile-file-to-string opt-template-file - (the-environment))) + (the-environment)))) - (gnc:debug "receipt.scm: css? is " css?) - (gnc:debug "receipt.scm: defined is " (defined? 'gnc-html-engine-supports-css)) (gnc:debug "receipt.scm - generated html:") (gnc:debug html) - (if css? ; return report as document or html, depending on version - html - (let ((document (gnc:make-html-document))) - (gnc:html-document-add-object! document html) - document)))) + html)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Define the report diff --git a/gnucash/report/business-reports/taxinvoice.scm b/gnucash/report/business-reports/taxinvoice.scm index 054b18ff49..fe94e64422 100644 --- a/gnucash/report/business-reports/taxinvoice.scm +++ b/gnucash/report/business-reports/taxinvoice.scm @@ -306,22 +306,14 @@ (opt-jobname-text (opt-value headingpage2 optname-jobname-text)) (opt-extra-css (opt-value notespage optname-extra-css)) (opt-extra-notes (opt-value notespage optname-extra-notes)) - (css? #t) ;(and (defined? 'gnc-html-engine-supports-css) (gnc-html-engine-supports-css))) - (html #f)) - - (set! html (eguile-file-to-string + (css? #t) + (html (eguile-file-to-string opt-template-file - (the-environment))) + (the-environment)))) - (gnc:debug "taxinvoice.scm: css? is " css?) - (gnc:debug "taxinvoice.scm: defined is " (defined? 'gnc-html-engine-supports-css)) (gnc:debug "taxinvoice.scm - generated html:") (gnc:debug html) - (if css? ; return report as document or html, depending on version - html - (let ((document (gnc:make-html-document))) - (gnc:html-document-add-object! document html) - document)))) + html)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Define the report diff --git a/gnucash/report/locale-specific/us/taxtxf.scm b/gnucash/report/locale-specific/us/taxtxf.scm index 76325deccd..f8d081848c 100644 --- a/gnucash/report/locale-specific/us/taxtxf.scm +++ b/gnucash/report/locale-specific/us/taxtxf.scm @@ -104,7 +104,7 @@ (use-modules (gnucash core-utils)) ; for gnc:version -(gnc:module-load "gnucash/html" 0) ; added for 'gnc-html-engine-supports-css' +(gnc:module-load "gnucash/html" 0) (gnc:module-load "gnucash/tax/us" 0) (gnc:module-load "gnucash/report/report-system" 0) @@ -262,13 +262,7 @@ (list 'conv-to-report-date (N_ "Nearest report date") (N_ "Use nearest to report date."))) ))) - (if (gnc-html-engine-supports-css) - #t - (gnc:register-tax-option - (gnc:make-simple-boolean-option - gnc:pagename-display (N_ "Shade alternate transactions") - "n" (N_ "Shade background of alternate transactions, if more than one displayed.") #f)) - ) + #t (gnc:options-set-default-section options gnc:pagename-general) @@ -2063,10 +2057,7 @@ "Do not print Action:Memo data") (get-option gnc:pagename-display "Do not print T-Num:Memo data"))) - (shade-alternate-transactions? (if (gnc-html-engine-supports-css) - #t - (get-option gnc:pagename-display - "Shade alternate transactions"))) + (shade-alternate-transactions? #t) (currency-conversion-date (get-option gnc:pagename-display "Currency conversion date")) (user-sel-accnts (get-option gnc:pagename-accounts @@ -3058,7 +3049,7 @@ #f) ;;end of if #f) ;;end of if (begin ; else do tax report - (if (gnc-html-engine-supports-css) + (if #t ;does gcn-html-engine-support-css? #t! (begin ;; this is for webkit (gnc:html-document-set-style! doc "header-just-top" @@ -3101,65 +3092,6 @@ 'tag "td" 'attribute (list "class" "number-cell neg") 'attribute (list "valign" "bottom")) - ) - (begin ;; this is for gtkhtml - (gnc:html-document-set-style! - doc "header-just-top" - 'tag "th" - 'attribute (list "align" "left") - 'attribute (list "valign" "top")) - - (gnc:html-document-set-style! - doc "header-just-bot" - 'tag "th" - 'attribute (list "align" "left") - 'attribute (list "valign" "bottom")) - - (gnc:html-document-set-style! - doc "column-heading-center" - 'tag "th" - 'attribute (list "align" "center") - 'attribute (list "valign" "bottom")) - - (gnc:html-document-set-style! - doc "tran-detail" - 'tag "tr" - 'attribute (list "valign" "top")) - - (gnc:html-document-set-style! - doc "tran-detail-shade" - 'tag "tr" - 'attribute (list "valign" "top") - 'attribute (list "bgcolor" "grey")) - - (gnc:html-document-set-style! - doc "column-heading-right" - 'tag "th" - 'attribute (list "align" "right")) - - (gnc:html-document-set-style! - doc "text-cell-center" - 'tag "td" - 'attribute (list "align" "center")) - - (gnc:html-document-set-style! - doc "number-cell-bot" - 'tag "td" - 'attribute (list "align" "right") - 'attribute (list "nowrap" "nowrap") - 'attribute (list "valign" "bottom")) - - (gnc:html-document-set-style! - doc "number-cell-bot-neg" - 'tag "td" - 'attribute (list "align" "right") - 'attribute (list "nowrap" "nowrap") - 'attribute (list "valign" "bottom")) - - (gnc:html-document-set-style! - doc "date-cell" - 'tag "td" - 'attribute (list "nowrap" "nowrap")) )) (gnc:html-document-set-style! @@ -3469,10 +3401,7 @@ ;; currency conversion date "      ~a
" ;; alternate transaction shading - (if (gnc-html-engine-supports-css) - "" - "      ~a
" - )) + "") (if (not (null? user-sel-accnts)) "Subset of accounts" "No accounts (none = all accounts)") @@ -3501,11 +3430,6 @@ 'conv-to-tran-date) "PriceDB lookups nearest to transaction date" "PriceDB lookups nearest to report end date") - (if (not (gnc-html-engine-supports-css)) - (if shade-alternate-transactions? - "Shade alternate transactions" - "Do not shade alternate transactions") - ) ) )))) diff --git a/gnucash/report/report-system/html-document.scm b/gnucash/report/report-system/html-document.scm index e9c77e845b..8325da6099 100644 --- a/gnucash/report/report-system/html-document.scm +++ b/gnucash/report/report-system/html-document.scm @@ -140,7 +140,6 @@ (push (lambda (l) (set! retval (cons l retval)))) (objs (gnc:html-document-objects doc)) (work-to-do (length objs)) - (css? (gnc-html-engine-supports-css)) (work-done 0) (title (gnc:html-document-title doc))) ;; compile the doc style @@ -160,9 +159,8 @@ (push "\n") (push "\n") (push "\n") - (if css? - (if style-text - (push (list "" style-text "" style-text "