mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/app-file/gw-app-file-spec.scm: fix for new g-wrap.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6543 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
941cf254ef
commit
1a40c9b628
@ -1,54 +1,33 @@
|
||||
;;; -*-scheme-*-
|
||||
(use-modules (g-wrap))
|
||||
|
||||
(define-module (g-wrapped gw-app-file-spec))
|
||||
(debug-set! maxdepth 100000)
|
||||
(debug-set! stack 2000000)
|
||||
|
||||
(define-module (g-wrapped gw-app-file-spec)
|
||||
:use-module (g-wrap))
|
||||
(use-modules (g-wrap))
|
||||
|
||||
(use-modules (g-wrap gw-standard-spec))
|
||||
(use-modules (g-wrap gw-glib-spec))
|
||||
|
||||
(use-modules (g-wrapped gw-engine-spec))
|
||||
(use-modules (g-wrapped gw-glib-spec))
|
||||
|
||||
(let ((mod (gw:new-module "gw-app-file")))
|
||||
(define (standard-c-call-gen result func-call-code)
|
||||
(list (gw:result-get-c-name result) " = " func-call-code ";\n"))
|
||||
(let ((ws (gw:new-wrapset "gw-app-file")))
|
||||
|
||||
(define (add-standard-result-handlers! type c->scm-converter)
|
||||
(define (standard-pre-handler result)
|
||||
(let* ((ret-type-name (gw:result-get-proper-c-type-name result))
|
||||
(ret-var-name (gw:result-get-c-name result)))
|
||||
(list "{\n"
|
||||
" " ret-type-name " " ret-var-name ";\n")))
|
||||
(gw:wrapset-depends-on ws "gw-standard")
|
||||
(gw:wrapset-depends-on ws "gw-glib")
|
||||
|
||||
(gw:type-set-pre-call-result-ccodegen! type standard-pre-handler)
|
||||
(gw:wrapset-depends-on ws "gw-engine")
|
||||
|
||||
(gw:type-set-post-call-result-ccodegen!
|
||||
type
|
||||
(lambda (result)
|
||||
(let* ((scm-name (gw:result-get-scm-name result))
|
||||
(c-name (gw:result-get-c-name result)))
|
||||
(list
|
||||
(c->scm-converter scm-name c-name)
|
||||
" }\n")))))
|
||||
(gw:wrapset-set-guile-module! ws '(g-wrapped gw-app-file))
|
||||
|
||||
(gw:module-depends-on mod "gw-runtime")
|
||||
(gw:module-depends-on mod "gw-engine")
|
||||
(gw:module-depends-on mod "gw-glib")
|
||||
|
||||
(gw:module-set-guile-module! mod '(g-wrapped gw-app-file))
|
||||
|
||||
(gw:module-set-declarations-ccodegen!
|
||||
mod
|
||||
(lambda (client-only?)
|
||||
(gw:wrapset-add-cs-declarations!
|
||||
ws
|
||||
(lambda (wrapset client-wrapset)
|
||||
(list
|
||||
"#include <gnc-file.h>\n"
|
||||
"#include <gnc-file-history.h>\n"
|
||||
"#include <gnc-file-dialog.h>\n")))
|
||||
|
||||
|
||||
|
||||
(gw:wrap-function
|
||||
mod
|
||||
ws
|
||||
'gnc:file-query-save
|
||||
'<gw:bool>
|
||||
"gnc_file_query_save"
|
||||
@ -57,7 +36,7 @@
|
||||
if they say 'Yes'. The return is false if the user says 'Cancel'.")
|
||||
|
||||
(gw:wrap-function
|
||||
mod
|
||||
ws
|
||||
'gnc:file-quit
|
||||
'<gw:void>
|
||||
"gnc_file_quit"
|
||||
@ -65,29 +44,29 @@ if they say 'Yes'. The return is false if the user says 'Cancel'.")
|
||||
"Stop working with the current file.")
|
||||
|
||||
(gw:wrap-function
|
||||
mod
|
||||
ws
|
||||
'gnc:file-open-file
|
||||
'<gw:bool>
|
||||
"gnc_file_open_file"
|
||||
'(((<gw:m-chars-caller-owned> gw:const) filename))
|
||||
'(((<gw:mchars> caller-owned const) filename))
|
||||
"Open filename.")
|
||||
|
||||
(gw:wrap-function
|
||||
mod
|
||||
ws
|
||||
'gnc:history-get-last
|
||||
'(<gw:m-chars-callee-owned> gw:const)
|
||||
'(<gw:mchars> callee-owned const)
|
||||
"gnc_history_get_last"
|
||||
'()
|
||||
"Get the last file opened by the user.")
|
||||
|
||||
(gw:wrap-function
|
||||
mod
|
||||
ws
|
||||
'gnc:file-selection-dialog
|
||||
'(<gw:m-chars-callee-owned> gw:const)
|
||||
'(<gw:mchars> callee-owned const)
|
||||
"gnc_file_dialog"
|
||||
'(((<gw:m-chars-caller-owned> gw:const) title)
|
||||
((<gw:m-chars-caller-owned> gw:const) filter)
|
||||
((<gw:m-chars-caller-owned> gw:const) default))
|
||||
'(((<gw:mchars> caller-owned const) title)
|
||||
((<gw:mchars> caller-owned const) filter)
|
||||
((<gw:mchars> caller-owned const) default))
|
||||
"Lets the user select a file. Dialog has given title, filter,
|
||||
or default name. Either filter, default, or both should be NULL.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user