]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/output-def-scheme.cc (LY_DEFINE): take default argument.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Jul 2005 01:11:50 +0000 (01:11 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Jul 2005 01:11:50 +0000 (01:11 +0000)
* lily/output-def.cc (lookup_variable): return SCM_UNDEFINED if undefined.

* Documentation/user/global.itely (Page formatting): document
horizontalshift.

* scm/page-layout.scm (default-page-music-height):
horizontalshift: new variable, shift all systems by
horizontalshift to the right, to make space for instrument names.

* scm/paper.scm (set-paper-dimension-variables): add horizontalshift

* lily/input-scheme.cc (LY_DEFINE): take format commands.

ChangeLog
Documentation/user/global.itely
VERSION
lily/font-interface.cc
lily/grob-scheme.cc
lily/input-scheme.cc
lily/output-def-scheme.cc
lily/output-def.cc
scm/page-layout.scm
scm/paper.scm

index 365f3186c052992a427320b46c9681d2ec43622b..ddd484e9188705e9aeb4e427571db07f7bcb3d06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-07-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/output-def-scheme.cc (LY_DEFINE): take default  argument.
+
+       * lily/output-def.cc (lookup_variable): return SCM_UNDEFINED if undefined.
+
+       * Documentation/user/global.itely (Page formatting): document
+       horizontalshift.
+
+       * scm/page-layout.scm (default-page-music-height):
+       horizontalshift: new variable, shift all systems by
+       horizontalshift to the right, to make space for instrument names.
+
+       * scm/paper.scm (set-paper-dimension-variables): add horizontalshift
+
+       * lily/input-scheme.cc (LY_DEFINE): take format commands.
 
 2005-07-20  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
@@ -10,6 +26,8 @@
        * lily/include/paper-column.hh (class Paper_column): add
        non-static get_rank() member.
 
+       * VERSION: release 2.7.1
+       
        * scm/framework-null.scm: new file, used for benchmarking.
 
 2005-07-20  Heikki Junes  <hjunes@cc.hut.fi>
index aa3a0e3ad8440fcf701aaef1d4c6493288799fcf..7ab893f2fdc578d49474d48c0b980a3490d8916e 100644 (file)
@@ -315,6 +315,14 @@ top-most of the next system.
 Increasing this will put systems whose bounding boxes almost touch
 farther apart.
 
+
+@item horizontalshift
+All systems (including titles and system separators) are shifted by
+this amount to the right. Page markup, such as headers and footers are
+not affected by this. The purpose of this variable is to make space
+for instrument names at the left.
+
+
 @item aftertitlespace
 Amount of space between the title and the first system.
 
diff --git a/VERSION b/VERSION
index 01f3dcadba1c79cc5ad29a73518e0bd4f64b175d..d07bd920b481d6d301abf7a8a0f6254b084de4db 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=1
+PATCH_LEVEL=2
 MY_PATCH_LEVEL=
 
index c9400629ae49589d88c0cc2d8a88ba0350611366..fe258a86dc4cdf522b4679a86b96bb1de565440d 100644 (file)
@@ -34,6 +34,8 @@ Font_interface::music_font_alist_chain (Grob *g)
 {
   SCM defaults
     = g->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+  if (defaults == SCM_UNDEFINED)
+    defaults = SCM_EOL;
   return g->get_property_alist_chain (defaults);
 }
 
@@ -42,6 +44,8 @@ Font_interface::text_font_alist_chain (Grob *g)
 {
   SCM defaults
     = g->get_layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
+  if (defaults == SCM_UNDEFINED)
+    defaults = SCM_EOL;
   return g->get_property_alist_chain (defaults);
 }
 
index 929a0dbaa7cef571ab03dfe6c4ab3d626701703f..07ac9dd820828def3e8a24e47e6cd94adc9bc02a 100644 (file)
@@ -93,9 +93,12 @@ LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
 
   if (global == SCM_UNDEFINED)
-    global
-      = sc->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
-
+    {
+      global = sc->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+      if (global == SCM_UNDEFINED)
+       global = SCM_EOL;
+    }
+  
   return sc->get_property_alist_chain (global);
 }
 
index 51432ff9b9833886a645acbb757fe57b17634d25..b38b6a999b15ce0bb00c14da2c841994e139db22 100644 (file)
@@ -18,14 +18,16 @@ LY_DEFINE (ly_input, "ly:input-location?", 1, 0, 0,
   return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
-          "Print @var{msg} as a GNU compliant error message, pointing to the"
-          "location in @var{sip}.\n")
+LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM rest),
+          "Print @var{msg} as a GNU compliant error message, pointing to the "
+          "location in @var{sip}. @var{msg} is interpreted similar to @code{format}'s argument\n")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
   SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string");
 
+  msg = scm_simple_format (SCM_BOOL_F, msg, rest);
+
   String m = ly_scm2string (msg);
   ip->message (m);
 
index 9e56fb79bb29c29bea919d89b143c153e1882b59..f71e15926fb4ddde2fa6b97a376e23ef2dbaaa1a 100644 (file)
 #include "context-def.hh"
 
 LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup",
-          2, 0, 0, (SCM pap, SCM sym),
+          2, 1, 0, (SCM pap, SCM sym, SCM def),
           "Lookup @var{sym} in @var{pap}. "
-          "Return the value or @code{'()} if undefined.")
+          "Return the value or @var{def} (which defaults to  @code{'()}) if undefined.")
 {
   Output_def *op = unsmob_output_def (pap);
   SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
   SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  
+  SCM answer = op->lookup_variable (sym);
+  if (answer == SCM_UNDEFINED)
+    {
+      if (def == SCM_UNDEFINED)
+       def = SCM_EOL;
+
+      answer = def;
+    }
 
-  return op->lookup_variable (sym);
+  return answer;
 }
 
 LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
index 0010d69b4f41286751856619721c82b5dd288103..c3f1955b76ffb1019c1e94197e513f2a16861ad9 100644 (file)
@@ -114,7 +114,7 @@ Output_def::lookup_variable (SCM sym) const
   if (parent_)
     return parent_->lookup_variable (sym);
   
-  return SCM_EOL;
+  return SCM_UNDEFINED;
 }
 
 SCM
index 08590f2f89d99865eecb08071f437d122d10cab7..5b3f01a5661df59c0f1c6894d5a96e94a28bb0c0 100644 (file)
@@ -84,7 +84,8 @@ create offsets.
 
         (vsize (ly:output-def-lookup layout 'vsize))
         (hsize (ly:output-def-lookup layout 'hsize))
-
+        
+        (system-xoffset (ly:output-def-lookup layout 'horizontalshift 0.0))
         (system-separator-markup (ly:output-def-lookup layout 'systemSeparatorMarkup))
         (system-separator-stencil (if (markup? system-separator-markup)
                                       (interpret-markup layout
@@ -93,53 +94,57 @@ create offsets.
                                       #f))
         (lmargin (ly:output-def-lookup layout 'leftmargin))
         (leftmargin (if lmargin
-                      lmargin
-                      (/ (- hsize
-                            (ly:output-def-lookup layout 'linewidth)) 2)))
-
-       (rightmargin (ly:output-def-lookup layout 'rightmargin))
-       (bottom-edge (- vsize
-                      (ly:output-def-lookup layout 'bottommargin)))
-
-       (head (page-headfoot layout scopes number 'make-header 'headsep UP last?))
-       (foot (page-headfoot layout scopes number 'make-footer 'footsep DOWN last?))
-
-       (head-height (if (ly:stencil? head)
-                       (interval-length (ly:stencil-extent head Y))
-                       0.0))
-
-       (height-proc (ly:output-def-lookup layout 'page-music-height))
-
-       (page-stencil (ly:make-stencil '()
-                                     (cons leftmargin hsize)
-                                     (cons (- topmargin) 0)))
-       (last-system #f)
-       (last-y 0.0)
-       (add-to-page (lambda (stencil y)
-                     (set! page-stencil
-                           (ly:stencil-add page-stencil
-                                           (ly:stencil-translate-axis stencil
-                                            (- 0 head-height y topmargin) Y)))))
-       (add-system
-       (lambda (stencil-position)
-         (let* ((system (car stencil-position))
-                (stencil (ly:paper-system-stencil system))
-                (y (cadr stencil-position))
-                (is-title (ly:paper-system-title?
-                           (car stencil-position))))
-           (add-to-page stencil y)
-           (if (and (ly:stencil? system-separator-stencil)
-                    last-system
-                    (not (ly:paper-system-title? system))
-                    (not (ly:paper-system-title? last-system)))
-               (add-to-page
-                system-separator-stencil
-                (average (- last-y
-                            (car (ly:paper-system-staff-extents last-system)))
-                         (- y
-                            (cdr (ly:paper-system-staff-extents system))))))
-           (set! last-system system)
-           (set! last-y y)))))
+                        lmargin
+                        (/ (- hsize
+                              (ly:output-def-lookup layout 'linewidth)) 2)))
+
+        (rightmargin (ly:output-def-lookup layout 'rightmargin))
+        (bottom-edge (- vsize
+                        (ly:output-def-lookup layout 'bottommargin)))
+
+        (head (page-headfoot layout scopes number 'make-header 'headsep UP last?))
+        (foot (page-headfoot layout scopes number 'make-footer 'footsep DOWN last?))
+
+        (head-height (if (ly:stencil? head)
+                         (interval-length (ly:stencil-extent head Y))
+                         0.0))
+
+        (height-proc (ly:output-def-lookup layout 'page-music-height))
+
+        (page-stencil (ly:make-stencil '()
+                                       (cons leftmargin hsize)
+                                       (cons (- topmargin) 0)))
+        (last-system #f)
+        (last-y 0.0)
+        (add-to-page (lambda (stencil y)
+                       (set! page-stencil
+                             (ly:stencil-add page-stencil
+                                             (ly:stencil-translate stencil
+                                                                   (cons
+                                                                    system-xoffset
+                                                                    (- 0 head-height y topmargin))
+
+                                                                   )))))
+        (add-system
+         (lambda (stencil-position)
+           (let* ((system (car stencil-position))
+                  (stencil (ly:paper-system-stencil system))
+                  (y (cadr stencil-position))
+                  (is-title (ly:paper-system-title?
+                             (car stencil-position))))
+             (add-to-page stencil y)
+             (if (and (ly:stencil? system-separator-stencil)
+                      last-system
+                      (not (ly:paper-system-title? system))
+                      (not (ly:paper-system-title? last-system)))
+                 (add-to-page
+                  system-separator-stencil
+                  (average (- last-y
+                              (car (ly:paper-system-staff-extents last-system)))
+                           (- y
+                              (cdr (ly:paper-system-staff-extents system))))))
+             (set! last-system system)
+             (set! last-y y)))))
 
     (if #f
        (display (list
index 932da61bbc008c08fb0b72d2349d984ec9a6cc18..d0d3a56a71158621ce9d5e0857c6411b97a2792e 100644 (file)
@@ -8,7 +8,7 @@
   (module-define! mod 'dimension-variables
                  '(pt mm cm in staffheight staff-space
                       betweensystemspace betweensystempadding
-                      linewidth indent hsize vsize
+                      linewidth indent hsize vsize horizontalshift
                       staffspace linethickness ledgerlinethickness
                       blotdiameter interscoreline leftmargin rightmargin)))