From 24b2d2fe1272a315c2b78a903fdfd1b82f51976c Mon Sep 17 00:00:00 2001 From: janneke Date: Thu, 17 Jun 2004 10:09:50 +0000 Subject: [PATCH] * lily/paper-outputter.cc (file): New method. (dump_string): Use it. * scm/output-gnome.scm: Update with pango CVS info, lilylib musing. * lily/accidental-engraver.cc: Bugfix: (do not sort lines if one of them has a comma :-). * scm/framework-gnome.scm: Add pango decoders. --- ChangeLog | 9 ++++ lily/accidental-engraver.cc | 27 +++++----- lily/include/paper-outputter.hh | 10 ++-- lily/paper-outputter.cc | 15 ++++-- scm/framework-gnome.scm | 14 +++-- scm/output-gnome.scm | 92 +++++++++++++++++---------------- 6 files changed, 95 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76778c0377..45a3c43de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2004-06-17 Jan Nieuwenhuizen + * lily/paper-outputter.cc (file): New method. + (dump_string): Use it. + + * scm/output-gnome.scm: Update with pango CVS info, lilylib + musing. + + * lily/accidental-engraver.cc: Bugfix: (do not sort lines if one + of them has a comma :-). + * scm/framework-gnome.scm: Add pango decoders. * lily/include/pangofc-afm-decoder.hh: diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index a43cf8b6a6..31e0998c9e 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -485,21 +485,22 @@ ENTER_DESCRIPTION (Accidental_engraver, "Catch note heads, ties and notices key-change events. " "This engraver usually lives at Staff level, but " "reads the settings for Accidental at @code{Voice} level, " - "so you can @code{\\override} them at @code{Voice}. ", - - "Accidental", - - "", - - "arpeggio-interface ", - "autoAccidentals " - "autoCautionaries", + "so you can @code{\\override} them at @code{Voice}. " + , + "Accidental" + , + "" + , + "arpeggio-interface " "finger-interface " "rhythmic-head-interface " "tie-interface " - + , + "autoAccidentals " + "autoCautionaries " "extraNatural " "harmonicAccidentals " - "localKeySignature " - - "localKeySignature"); + "localKeySignature" + , + "localKeySignature" + ); diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 730748dd0a..96544542e1 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -23,11 +23,13 @@ class Paper_outputter { SCM output_module_; - SCM file_; String filename_; + SCM file_; + + SCM file (); public: - DECLARE_SMOBS(Paper_outputter,); + DECLARE_SMOBS (Paper_outputter,); public: SCM dump_string (SCM); @@ -37,7 +39,7 @@ public: void output_stencil (Stencil); }; -Paper_outputter* get_paper_outputter (String,String); -DECLARE_UNSMOB(Paper_outputter, outputter); +Paper_outputter *get_paper_outputter (String, String); +DECLARE_UNSMOB (Paper_outputter, outputter); #endif /* PAPER_OUTPUTTER_HH */ diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 163673e31e..bb9c3812cf 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -38,9 +38,6 @@ Paper_outputter::Paper_outputter (String filename, String format) smobify_self (); filename_ = filename; - file_ = scm_open_file (scm_makfrom0str (filename.to_str0 ()), - scm_makfrom0str ("w")); - String module_name = "scm output-" + format; output_module_ = scm_c_resolve_module (module_name.to_str0 ()); } @@ -69,10 +66,19 @@ Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*) return 1; } +SCM +Paper_outputter::file () +{ + if (file_ == SCM_EOL) + file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()), + scm_makfrom0str ("w")); + return file_; +} + SCM Paper_outputter::dump_string (SCM scm) { - return scm_display (scm, file_); + return scm_display (scm, file ()); } SCM @@ -101,7 +107,6 @@ Paper_outputter::output_stencil (Stencil stil) (void*) this, Offset (0,0)); } - Paper_outputter * get_paper_outputter (String outname, String f) { diff --git a/scm/framework-gnome.scm b/scm/framework-gnome.scm index bc62a7aa22..031cb3c972 100644 --- a/scm/framework-gnome.scm +++ b/scm/framework-gnome.scm @@ -22,11 +22,15 @@ (use-modules (gnome gw libgnomecanvas))) (define-public (output-framework-gnome outputter book scopes fields basename) - (if #t - (gnome-main book) - (ly:outputter-dump-stencil - outputter - (ly:make-stencil (list 'gnome-main book) '(0 . 0) '(0 . 0))))) + (newline (current-error-port)) + +; ;; Hmm, +; (let ((port (ly:outputter-get-output-port outputter))) +; (remove port) +; (close port)) + + (gnome-main book)) + ;; WTF? -- jcn ;; Yay, I *finally* found it! diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 972a50c703..1364e4a7ec 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -4,64 +4,61 @@ ;;;; ;;;; (c) 2004 Jan Nieuwenhuizen -;;; HIP -- hack in progress +;;; TODO: ;;; +;;; * Figure out and fix font scaling and character placement +;;; * User-interface, keybindings +;;; * Implement missing stencil functions +;;; * Implement missing commands +;;; * Embedded Lily: +;;; - allow GnomeCanvas or `toplevel' GtkWindow to be created +;;; outside of LilyPond +;;; - lilylib. +;;; * Release schedule and packaging of dependencies. This hack +;;; depends on several CVS and TLA developent sources. + ;;; You need: ;;; -;;; * guile-1.6.4 (NOT CVS) -;;; * Rotty's g-wrap--tng, possibly Janneke's if you have libffi-3.4. -;;; -;;; see also: guile-gtk-general@gnu.org +;;; * guile-1.6.4 (NOT CVS -- we are working on this) +;;; * Rotty's g-wrap--tng TLA, possibly Janneke's if you have libffi-3.4. +;;; * guile-gnome TLA +;;; * pango CVS (ie, > 2004-06-12) ;;; +;;; See also: guile-gtk-general@gnu.org + ;;; Try it ;;; -;;; * If using GUILE CVS , then compile LilyPond with GUILE 1.6, -;;; -;;; PATH=/usr/bin/:$PATH ./configure --enable-config=g16 ; make conf=g16 -;;; -;;; * Install gnome/gtk development stuff and g-wrap, guile-gnome -;;; see buildscripts/guile-gnome.sh -;;; -;;; * Use latin1 encoding for gnome backend, do -;;; +;;; * If you are using GUILE CVS, recompile LilyPond with GUILE 1.6. + +;;; [If for some unknown or funny reason you do not want to +;;; overwrite your lilypond-bin with GUILE CVS, you can +;;; reconfigure a new configuration, say g16: " - ./configure --prefix=$(pwd) --enable-config=g16 - make -C mf conf=g16 clean - make -C mf conf=g16 ENCODING_FILE=$(kpsewhich cork.enc) - (cd mf/out-g16 && mkfontdir) - xset +fp $(pwd)/mf/out-g16 +PATH=/usr/bin/:$PATH ./configure --enable-config=g16 && make conf=g16 " +;;; ] ;;; +;;; * Install gnome/gtk development stuff +;;; +;;; * Install g-wrap and guile-gnome, see buildscripts/guile-gnome.sh +;;; ;;; * Setup environment " export GUILE_LOAD_PATH=$HOME/usr/pkg/g-wrap/share/guile/site:$HOME/usr/pkg/g-wrap/share/guile/site/g-wrap:$HOME/usr/pkg/guile-gnome/share/guile export LD_LIBRARY_PATH=$HOME/usr/pkg/g-wrap/lib:$HOME/usr/pkg/guile-gnome/lib export XEDITOR='/usr/bin/emacsclient --no-wait +%l:%c %f' " -;;; * For GNOME point-and-click, add -;;; #(ly:set-point-and-click 'line-column) -;;; to your .ly; just click an object on the canvas. +;;; * Also for GNOME point-and-click, you need to set XEDITOR and add +" +#(ly:set-point-and-click 'line-column) +" +;;; to your .ly; then click an object on the canvas. ;;; ;;; * Run lily: " lilypond-bin -fgnome input/simple-song.ly " -;;; TODO: -;;; * pango+feta font (see archives gtk-i18n-list@gnome.org and -;;; lilypond-devel) -;;; - wait for/help with pango 1.6 -;;; - convert feta to OpenType (CFF) or TrueType (fontforge?) -;;; - hack feta20/feta20.pfa?: -;;; * font, canvas, scaling? -;;; * implement missing stencil functions -;;; * implement missing commands -;;; * user-interface, keybindings -;;; * papersize, outputscale from book - - -;;; SCRIPT moved to buildscripts/guile-gnome.sh - (debug-enable 'backtrace) @@ -74,19 +71,24 @@ lilypond-bin -fgnome input/simple-song.ly (lily) (gnome gtk)) -;; the name of the module will change to canvas rsn + +;; The name of the module will change to `canvas' rsn (if (resolve-module '(gnome gw canvas)) (use-modules (gnome gw canvas)) (use-modules (gnome gw libgnomecanvas))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; globals + +;; junkme (define system-origin '(0 . 0)) -;;; set by framework-gnome.scm: +;;; set by framework-gnome.scm (define canvas-root #f) (define output-scale #f) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; helper functions @@ -129,13 +131,16 @@ lilypond-bin -fgnome input/simple-song.ly ;;; stencil outputters ;;; +;;; catch-all for missing stuff +;;; comment this out to see find out what functions you miss :-) (define (dummy . foo) #f) - (map (lambda (x) (module-define! this-module x dummy)) (append (ly:all-stencil-expressions) (ly:all-output-backend-commands))) + + (define (char font i) (text font (utf8 i))) @@ -163,6 +168,7 @@ lilypond-bin -fgnome input/simple-song.ly ((equal? (ly:font-name font) "GNU-LilyPond-feta-20") "lilypond-feta, regular 32") (else + ;; FIXME "ecrm12"))) ;;(ly:font-name font)))) ;;(ly:font-filename font)))) @@ -234,12 +240,8 @@ lilypond-bin -fgnome input/simple-song.ly ;; WTF is this in every backend? (define (horizontal-line x1 x2 thickness) - ;;(let ((thickness 2)) (filledbox (- x1) (- x2 x1) (* .5 thickness) (* .5 thickness))) (define (define-origin file line col) (if (procedure? point-and-click) - ;; duh, only silly string append - ;; (point-and-click line col file) - (list 'location line col file) - #f)) + (list 'location line col file))) -- 2.39.5