mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[modularise] (gnucash gnome-utils)
This commit is contained in:
parent
33dd16915b
commit
dd4b88c386
@ -261,17 +261,16 @@ install(FILES ${gnome_utils_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnu
|
|||||||
set(GUILE_DEPENDS gnc-gnome-utils scm-engine scm-app-utils)
|
set(GUILE_DEPENDS gnc-gnome-utils scm-engine scm-app-utils)
|
||||||
|
|
||||||
gnc_add_scheme_targets(scm-gnome-utils-1
|
gnc_add_scheme_targets(scm-gnome-utils-1
|
||||||
SOURCES gnome-utils.scm
|
|
||||||
OUTPUT_DIR gnucash
|
|
||||||
DEPENDS "${GUILE_DEPENDS}")
|
|
||||||
|
|
||||||
|
|
||||||
gnc_add_scheme_targets(scm-gnome-utils-2
|
|
||||||
SOURCES gnc-menu-extensions.scm
|
SOURCES gnc-menu-extensions.scm
|
||||||
OUTPUT_DIR "gnucash/gnome-utils"
|
OUTPUT_DIR "gnucash/gnome-utils"
|
||||||
DEPENDS "${GUILE_DEPENDS}"
|
DEPENDS "${GUILE_DEPENDS}"
|
||||||
MAKE_LINKS)
|
MAKE_LINKS)
|
||||||
|
|
||||||
|
gnc_add_scheme_targets(scm-gnome-utils-2
|
||||||
|
SOURCES gnome-utils.scm
|
||||||
|
OUTPUT_DIR gnucash
|
||||||
|
DEPENDS "scm-gnome-utils-1")
|
||||||
|
|
||||||
add_custom_target(scm-gnome-utils ALL DEPENDS scm-gnome-utils-2 scm-gnome-utils-1)
|
add_custom_target(scm-gnome-utils ALL DEPENDS scm-gnome-utils-2 scm-gnome-utils-1)
|
||||||
|
|
||||||
set_local_dist(gnome_utils_DIST_local CMakeLists.txt ${gnome_utils_SOURCES} ${gnome_utils_HEADERS}
|
set_local_dist(gnome_utils_DIST_local CMakeLists.txt ${gnome_utils_SOURCES} ${gnome_utils_HEADERS}
|
||||||
|
@ -15,40 +15,30 @@
|
|||||||
;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||||
;; Boston, MA 02110-1301, USA gnu@gnu.org
|
;; Boston, MA 02110-1301, USA gnu@gnu.org
|
||||||
|
|
||||||
(define (gnc:make-extension
|
(define-module (gnucash gnome-utils gnc-menu-extensions))
|
||||||
;; The type of extension item, either 'menu, 'menu-item, or 'separator
|
|
||||||
type
|
|
||||||
;; The name of the extension in the menu
|
|
||||||
name
|
|
||||||
;; The guid of object the menu will refer to
|
|
||||||
guid
|
|
||||||
;; The tooltip
|
|
||||||
documentation-string
|
|
||||||
;; A list of names indicating the menus under which this item is
|
|
||||||
;; located. The last item indicates the item *after* which this
|
|
||||||
;; extension will go.
|
|
||||||
path
|
|
||||||
;; The script to call when the menu item is selected
|
|
||||||
script)
|
|
||||||
(vector type
|
|
||||||
name
|
|
||||||
guid
|
|
||||||
documentation-string
|
|
||||||
path
|
|
||||||
script))
|
|
||||||
|
|
||||||
(define (gnc:extension-type extension)
|
(use-modules (srfi srfi-9))
|
||||||
(vector-ref extension 0))
|
|
||||||
(define (gnc:extension-name extension)
|
(export gnc:extension-documentation)
|
||||||
(vector-ref extension 1))
|
(export gnc:extension-guid)
|
||||||
(define (gnc:extension-guid extension)
|
(export gnc:extension-name)
|
||||||
(vector-ref extension 2))
|
(export gnc:extension-path)
|
||||||
(define (gnc:extension-documentation extension)
|
(export gnc:extension-script)
|
||||||
(vector-ref extension 3))
|
(export gnc:extension-type)
|
||||||
(define (gnc:extension-path extension)
|
(export gnc:make-extension)
|
||||||
(vector-ref extension 4))
|
(export gnc:make-menu)
|
||||||
(define (gnc:extension-script extension)
|
(export gnc:make-menu-item)
|
||||||
(vector-ref extension 5))
|
(export gnc:make-separator)
|
||||||
|
|
||||||
|
(define-record-type :extension
|
||||||
|
(gnc:make-extension type name guid documentation-string path script)
|
||||||
|
:extension?
|
||||||
|
(type gnc:extension-type)
|
||||||
|
(name gnc:extension-name)
|
||||||
|
(guid gnc:extension-guid)
|
||||||
|
(documentation-string gnc:extension-documentation)
|
||||||
|
(path gnc:extension-path)
|
||||||
|
(script gnc:extension-script))
|
||||||
|
|
||||||
(define (gnc:make-menu-item name guid documentation-string path script)
|
(define (gnc:make-menu-item name guid documentation-string path script)
|
||||||
(gnc:make-extension 'menu-item name guid documentation-string path script))
|
(gnc:make-extension 'menu-item name guid documentation-string path script))
|
||||||
|
@ -19,30 +19,16 @@
|
|||||||
|
|
||||||
(define-module (gnucash gnome-utils))
|
(define-module (gnucash gnome-utils))
|
||||||
|
|
||||||
|
(eval-when (compile load eval expand)
|
||||||
|
(load-extension "libgnc-gnome-utils" "scm_init_sw_gnome_utils_module"))
|
||||||
|
|
||||||
|
(use-modules (gnucash core-utils))
|
||||||
(use-modules (gnucash engine))
|
(use-modules (gnucash engine))
|
||||||
(use-modules (gnucash utilities))
|
(use-modules (gnucash utilities))
|
||||||
(use-modules (gnucash app-utils))
|
(use-modules (gnucash app-utils))
|
||||||
|
|
||||||
(eval-when (compile load eval expand)
|
(load-and-reexport (sw_gnome_utils)
|
||||||
(load-extension "libgnc-gnome-utils" "scm_init_sw_gnome_utils_module"))
|
(gnucash gnome-utils gnc-menu-extensions))
|
||||||
(use-modules (sw_gnome_utils))
|
|
||||||
|
|
||||||
; Export the swig-wrapped symbols in the public interface of this module
|
|
||||||
(let ((i (module-public-interface (current-module))))
|
|
||||||
(module-use! i (resolve-interface '(sw_gnome_utils))))
|
|
||||||
|
|
||||||
;; from gnc-menu-extensions.scm
|
|
||||||
(export gnc:extension-type)
|
|
||||||
(export gnc:extension-name)
|
|
||||||
(export gnc:extension-guid)
|
|
||||||
(export gnc:extension-documentation)
|
|
||||||
(export gnc:extension-path)
|
|
||||||
(export gnc:extension-script)
|
|
||||||
(export gnc:make-menu-item)
|
|
||||||
(export gnc:make-menu)
|
|
||||||
(export gnc:make-separator)
|
|
||||||
|
|
||||||
(load-from-path "gnucash/gnome-utils/gnc-menu-extensions")
|
|
||||||
|
|
||||||
;; this function will receive 1 boolean argument, and can be used for
|
;; this function will receive 1 boolean argument, and can be used for
|
||||||
;; any UI init/shutdown routines. For now it will set the
|
;; any UI init/shutdown routines. For now it will set the
|
||||||
|
Loading…
Reference in New Issue
Block a user