]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/framework-gnome.scm (output-framework-gnome): Try loading
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Jun 2004 16:41:09 +0000 (16:41 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Jun 2004 16:41:09 +0000 (16:41 +0000)
gnome modules from non-toplevel.

* lily/ly-module.cc (ly:import-module): Export to ly:.

ChangeLog
lily/include/ly-module.hh
lily/ly-module.cc
scm/framework-gnome.scm
scm/output-gnome.scm

index 4c94a60dca8d9a21bd6ba3c23949ea8961b0ffef..3f65b6dc6c3f0c4d6ffd9f030b2198757ddd3190 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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
index 9d2e54095ec36f46d652ca0ea1e486684b678b54..1862845cdeca46e85c491a1e59bbc69a9e31959f 100644 (file)
@@ -1,19 +1,17 @@
 /*
   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);
index 6e344e60776aa553fdf0b96219c2600b9c20f112..24ddaf8d7e36b26e5609a42b5f9edbdd4208c9c7 100644 (file)
@@ -1,10 +1,9 @@
 /*
   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"
@@ -71,12 +70,14 @@ ly_module_define (void *closure, SCM key, SCM val, SCM result)
 /* 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
index aff36185a85e291278dbd1ffd4391d338bd15248..33c895322406d84cd6e0782b364fdbb638d84b5b 100644 (file)
 (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)
index e5701a1c2213dcbf4e440d837af55702d9d71ee1..c1d6e4954d4ee63893ea9dd80e4830b6dd5b4a89 100644 (file)
@@ -308,8 +308,6 @@ lilypond-bin -fgnome input/simple-song.ly
                     (list line col file)
                     #f)))
 
-
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; gnome stuff  --- move to framework-gnome
 (define (dump-page number)