From: Jan Nieuwenhuizen Date: Tue, 27 Apr 2004 23:11:45 +0000 (+0000) Subject: * input/test/markup-score.ly: New file. X-Git-Tag: release/2.3.1~41 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=375bf058e85ae51457f4f8c8486fc9ebb2105bfe;p=lilypond.git * input/test/markup-score.ly: New file. * scm/define-markup-commands.scm (stencil): New markup. * lily/parser.yy (markup): Use it to grok \score. --- diff --git a/ChangeLog b/ChangeLog index cd5b51712a..8f33232174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-04-28 Jan Nieuwenhuizen + * input/test/markup-score.ly: New file. + + * scm/define-markup-commands.scm (stencil): New markup. + * lily/book.cc (to_stencil): New method. * lily/parser.yy (markup): Use it to grok \score. diff --git a/input/test/markup-score.ly b/input/test/markup-score.ly new file mode 100644 index 0000000000..8e1966ff7e --- /dev/null +++ b/input/test/markup-score.ly @@ -0,0 +1,41 @@ + +\header { + %% WIP + texidoc = "Use \\score block as markup command." + +} + +\version "2.3.1" + + +\paper { + raggedright = ##t + vsize = 30 \mm + linewidth = 30\mm + indent = 0 \mm + hsize = 40\mm +} +\header { + title = "title" + subtitle = \markup { \fill-line < + "subtitle with score: " + \score { \relative \notes { a'^"Hi" b c } } + "woo!" + > } + subsubtitle = "subsubtitle" +} + +\paper { + raggedright = ##f + linewidth = 150\mm + indent = 15\mm + vsize = 298\mm + hsize = 210 \mm +} + +\relative { + a' b c d \break + a b c d \break + a b c d \break +} + diff --git a/lily/parser.yy b/lily/parser.yy index 033e57158a..5914531b85 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2446,15 +2446,15 @@ markup: $$ = $1; } | score_block { + // WIP -- arbitrary, shoul also allow \book or Composite_music. Score *score = $1; - //Book *book = unsmob_book (ly_score_bookify (score->self_scm ())); Book *book = new Book; book->scores_.push (score); extern Music_output_def* get_paper (My_lily_parser *parser); Music_output_def *paper = get_paper (THIS); SCM s = book->to_stencil (paper, THIS->header_); -// $$ = s; - $$ = Text_item::interpret_markup (paper->self_scm (), SCM_EOL, s); + $$ = scm_list_2 (ly_scheme_function ("stencil-markup"), s); + scm_gc_unprotect_object (score->self_scm ()); } ; diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index fa7666419b..f5114886c8 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -11,7 +11,10 @@ ;; syntax, description and example. - +(def-markup-command (stencil paper props stil) (ly:stencil?) + "Stencil as markup" + stil) + (def-markup-command (simple paper props str) (string?) "A simple text string; @code{\\markup @{ foo @}} is equivalent with @code{\\markup @{ \\simple #\"foo\" @}}."