gnome modules from non-toplevel.
* lily/ly-module.cc (ly:import-module): Export to ly:.
2004-06-14 Jan Nieuwenhuizen <janneke@gnu.org>
+ * scm/framework-gnome.scm (output-framework-gnome): Try loading
+ gnome modules from non-toplevel.
+
+ * lily/ly-module.cc (ly:import-module): Export to ly:.
+
* lily/paper-score.cc (process): Do not show progress newline.
* lily/paper-book.cc (output, classic_output): Show progess
/*
ly-module.hh -- declare module related helper functions
- source file of the GNU LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
*/
-
#ifndef LY_MODULE_HH
#define LY_MODULE_HH
#include "lily-guile.hh"
SCM ly_make_anonymous_module (bool safe);
-void ly_import_module (SCM dest, SCM src);
+SCM ly_import_module (SCM dest, SCM src);
SCM ly_module2alist (SCM mod);
SCM ly_module_lookup (SCM module, SCM sym);
SCM ly_modules_lookup (SCM modules, SCM sym, SCM);
/*
ly-module.cc -- implement guile module stuff.
-
+
source file of the GNU LilyPond music typesetter
-
- (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "main.hh"
/* Ugh signature of scm_internal_hash_fold () is inaccurate. */
typedef SCM (*Hash_cl_func)();
-void
-ly_import_module (SCM dest, SCM src)
+LY_DEFINE (ly_import_module, "ly:import-module",
+ 2, 0, 0, (SCM dest, SCM src),
+ "Import all bindings from module SRC into DEST.")
{
SCM_VALIDATE_MODULE (1, src);
scm_internal_hash_fold ((Hash_cl_func) &ly_module_define, (void*) dest,
SCM_EOL, SCM_MODULE_OBARRAY (src));
+ return SCM_UNDEFINED;
}
static SCM
(define-public (output-framework-gnome outputter book scopes fields basename)
(let* ((bookpaper (ly:paper-book-book-paper book))
(pages (list->vector (ly:paper-book-pages book))))
+
+;; try #1
+ (if #f
+ (use-modules
+ (gnome gtk)
+ (gnome gtk gdk-event)
+ (gnome gw canvas)))
+
+;; try #2
+ ;; waarom maken ze dit nou allemaal toch weer zo moeilijk?
+ ;; is there any documentation about modules for guile 1.6.4?
+ (map (lambda (x) (ly:import-module (current-module) (resolve-module x)))
+ '((gnome gtk)
+ (gnome gtk gdk-event)
+ (gnome gw canvas)))
+
+ (if #f
+ (let* ((window (make <gtk-window> #:type 'toplevel)))
+ (write window)))
+ ;; try #3
+ (if #f
+ (let ((the-module-previously-known-as-current-module (current-module)))
+ (map (lambda (x) (ly:import-module
+ the-module-previously-known-as-current-module
+ (resolve-module x)))
+ '((gnome gtk)
+ (gnome gtk gdk-event)
+ (gnome gw canvas)))
+
+ (eval '(let* ((window (make <gtk-window> #:type 'toplevel)))
+ (write window))
+ the-module-previously-known-as-current-module)))
+
+ ;;try #4
+ (if #f
+ (eval '(use-modules
+ (gnome gtk)
+ (gnome gtk gdk-event)
+ (gnome gw canvas))
+ (let* ((window (make <gtk-window> #:type 'toplevel)))
+ (write window))
+ (current-module)))
+
(ly:outputter-dump-stencil
outputter
(ly:make-stencil (list 'main outputter bookpaper pages)
(list line col file)
#f)))
-
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; gnome stuff --- move to framework-gnome
(define (dump-page number)