]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/convert-ly.py (datadir): add prefix switching hack to
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 21 Oct 2005 13:54:32 +0000 (13:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 21 Oct 2005 13:54:32 +0000 (13:54 +0000)
.py too.

* lily/grob-property.cc (del_property): new function.

22 files changed:
ChangeLog
Documentation/topdocs/NEWS.tely
Documentation/user/advanced-notation.itely
Documentation/user/basic-notation.itely
Documentation/user/changing-defaults.itely
Documentation/user/instrument-notation.itely
Documentation/user/introduction.itely
GNUmakefile.in
VERSION
input/regression/balloon.ly
input/regression/lyric-hyphen-retain.ly
input/regression/multi-measure-rest-text.ly
input/regression/spacing-folded-clef2.ly
input/regression/stencil-hacking.ly
input/regression/system-extents.ly
lily/cluster.cc
lily/context-property.cc
lily/grob-property.cc
lily/grob-scheme.cc
python/convertrules.py
scm/define-grob-interfaces.scm
scripts/convert-ly.py

index bbf53e7c4c5823633738d775bbe9eece921bb2ba..fe8aebfeebf3cefadd5577f3bf0e59e667386e9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-10-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scripts/convert-ly.py (datadir): add prefix switching hack to
+       .py too.
+
        * input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily (cresc): remove
        space-function tweak.
 
index 12250ac0c12ed292ffbd20e8b84c44bfaeae0792..b8fb79aea9cfe621f5c2fb4f7500b7cbcd1d7e6c 100644 (file)
@@ -45,6 +45,25 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+
+@item
+Each grob property can be a procedure. If this is the case, it is
+assumed to be a routine that calculates said property.  This is a
+major internal cleanup, which also provides advanced tweakability for
+power users. For example,
+
+@verbatim
+\override Beam #'direction
+  = #(lambda (grob)
+      (if (> 4 (ly:grob-array-length (ly:grob-object grob 'stems)))
+          DOWN
+          UP))
+@end verbatim 
+
+@noindent
+With this code fragment, the direction of a beam is decided to be up
+or down, depending on the number of stems in the beam.
+
 @item
 Support for figured bass has been rewritten. Now it supports
 continuation lines, slashed figures, and its figures, brackets, and alignments may
@@ -61,23 +80,6 @@ tuned separately.
 
 This rewrite was sponsored by Trent Johnston and John Mandereau.
 
-@item
-For each grob, a subproperty in @code{callbacks} property defines the
-procedure which computes it. This is a major internal cleanup, which
-also provides advanced tweakability for power users. For example,
-
-@verbatim
-\override Beam #'callbacks #'direction
-  = #(lambda (grob)
-      (if (> 4 (ly:grob-array-length (ly:grob-object grob 'stems)))
-          DOWN
-          UP))
-@end verbatim 
-
-@noindent
-With this code fragment, the direction of a beam is decided to be up
-or down, depending on the number of stems in the beam.
-
 @item
 Subproperties, like the @code{details} field of @code{Slur} and
 @code{Tie} may now be tuned with @code{\override}. For example, 
index 42f34ba89d3a6f96221b68a433ca7acd91543cde..922d9aeec0c2a12327efa5e9d94b9e29b7ac1c52 100644 (file)
@@ -1524,7 +1524,7 @@ tsMarkup =\markup {
 }
 
 {
-  \override Staff.TimeSignature #'callbacks #'stencil = #Text_interface::print
+  \override Staff.TimeSignature #'stencil = #Text_interface::print
   \override Staff.TimeSignature #'text = #tsMarkup
   \time 3/2
   c'2 \bar ":" c'4 c'4.
index 7db71430b6302519473a1948f178bdd801aa3971..16537383934c30f1d27192488df90b9a7ac00075 100644 (file)
@@ -2987,7 +2987,7 @@ Isolated percents can also be printed. This is done by putting a multi
 measure rest with a different print function,
 
 @lilypond[fragment,verbatim]
-\override MultiMeasureRest #'callbacks #'stencil
+\override MultiMeasureRest #'stencil
   = #Multi_measure_rest::percent
 R1
 @end lilypond
index 9af5cee0593b0ea423618d71b801c4e52f209e24..152a55ba5cedb6976b0fc5da048da16f61a0d6bb 100644 (file)
@@ -1324,7 +1324,7 @@ of the broken tie is translated up.
      (ly:grob-set-property! grob 'extra-offset '(-2 . 5)))))
 
 \relative c'' { 
-  \override Tie #'callbacks #'after-line-breaking =
+  \override Tie #'after-line-breaking =
   #my-callback
   c1 ~ \break c2 ~ c
 }
index bed34c62f509c1a69d7fdf47060b3e48121599ea..4c05f063852c1e6b2b3f07909ac5e4df937f6d4d 100644 (file)
@@ -881,7 +881,7 @@ the @code{LyricHyphen} grob.
       An -- ti -- cons -- ti --
       tu -- tion -- nel -- le --
       \override LyricHyphen  #'minimum-length = #0.7
-      \override LyricHyphen  #'callbacks #'springs-and-rods =
+      \override LyricHyphen  #'springs-and-rods =
         #Hyphen_spanner::set_spacing_rods
       men -- taire -- ment. ouf~!
     }
index 3d8b8c540e22b72f5591bfc862917ce0b4763cfb..b0dbe6824a30f71c6d5a86c61f70da671d9ac6a6 100644 (file)
@@ -336,7 +336,7 @@ fragment.
    \set autoBeaming = ##f
    \time 2/4
    <d f g>4
-   \once \override NoteHead #'callbacks #'stencil = #Note_head::brew_ez_stencil
+   \once \override NoteHead #'stencil = #Note_head::brew_ez_stencil
    <d f g>
    \once \override NoteHead #'style = #'cross
    <d f g>
index 7fef24ff723cbc2827a34486f39627bfb1e8b3a7..574cf4b7b1036ca3e7297355c4dfd451845483a2 100644 (file)
@@ -116,12 +116,12 @@ $(tree-prefix)/lilypond-force link-tree: GNUmakefile
        mkdir -p $(tree-prefix)/fonts/enc
        mkdir -p $(tree-prefix)/tex
        cd $(top-build-dir)/$(outbase)/lib && \
-               ln -s  ../../../python/$(outconfbase) python
+               ln -s ../../../../python/$(outconfbase) python
        cd $(tree-prefix) && \
                ln -s $(top-src-dir)/ly ly && \
                ln -s ../../../../mf mf && \
                ln -s $(top-src-dir)/ps && \
-               ln -s ../../../python/$(outconfbase) python && \
+               ln -s ../../../../python/$(outconfbase) python && \
                ln -s $(top-src-dir)/scm && \
                ln -s $(top-src-dir)/scripts scripts
        cd $(tree-prefix)/dvips && \
diff --git a/VERSION b/VERSION
index 38bfbcfef36d7ff158a1ce5b604dcd77e20d57ea..7f57d381b86ac3b271e927ea4e4b8548aec078ce 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=13
+PATCH_LEVEL=14
 MY_PATCH_LEVEL=
 
index 1f20c4285d18cec3f5b2d7a79a77113c8cf9536f..c7f78c45cd34702c948948fbe333f99bba086e5d 100644 (file)
@@ -12,8 +12,8 @@ with lines and explanatory text added."
   \relative c'  {
 
     %% by hand:
-    \once\override Stem #'callbacks #'stencil = #Balloon_interface::print
-    \once\override Stem #'balloon-original-callback = #Stem::print
+    \once\override Stem #'stencil = #Balloon_interface::print
+    \once\override Stem #'original-stencil = #Stem::print
     \once\override Stem #'balloon-text = #"I'm a stem"
     \once\override Stem #'balloon-text-offset = #'(3 . 4)
     \once\override Stem #'balloon-text-props
index dd3beddf4b668ae313f1c5d8da55d261adc1111a..d066169fcc821437776e9711b879a7aa1ac56a3f 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.7.13"
+\version "2.7.14"
 
 \header {
 
@@ -38,7 +38,7 @@ amount
     bla -- bla -- bla -- bla --
 
     \override LyricHyphen  #'minimum-length = #0.7
-    \override LyricHyphen #'callbacks #'springs-and-rods =
+    \override LyricHyphen  #'springs-and-rods =
     #Hyphen_spanner::set_spacing_rods
 
     bla -- bla -- bla -- bla 
index 7d8d54959f0972613896df27d55a05e8f333996c..b53496b00cfca2a17a1d6965747fa69dc3e01eec 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.7.13"
+\version "2.7.14"
 
 \header  {
 
@@ -22,7 +22,7 @@ measures stretch to accomodate wide texts.
   R2.^"4"
   R2.*3_\markup { \roman "a1b2c3" }
   R2.*10^"inner"^"top"_"inner"_"bot"
-  \override MultiMeasureRestText #'callbacks #'springs-and-rods
+  \override MultiMeasureRestText  #'springs-and-rods
     = #Multi_measure_rest::set_text_rods
 
   R2.^"very very very very very very long text"
index 3910763faf6490264d43b0399be77790d14e9ca3..23e6ff2cd7231aca0cb0a4c8c8eb0e4400b2e0d3 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.7.13"
+\version "2.7.14"
 \header {
 
 texidoc = "A clef can be folded below notes in a different staff, if
@@ -11,8 +11,8 @@ can show where columns are in the score."
 
     \context {
        \Score
-       \override NonMusicalPaperColumn #'callbacks #'stencil = #Paper_column::print
-       \override PaperColumn #'callbacks #'stencil = #Paper_column::print        
+       \override NonMusicalPaperColumn  #'stencil = #Paper_column::print
+       \override PaperColumn  #'stencil = #Paper_column::print   
        \override NonMusicalPaperColumn #'font-family = #'roman
        \override PaperColumn #'font-family = #'roman     
 
index b5ec1dfa0b8519a5d843fe3e61c799cc53ac8b38..9cdf19d0df1b41f99297e838cc230d06fc38c3ff 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.7.13"
+\version "2.7.14"
 
 \header { texidoc=" You can write stencil callbacks in Scheme, thus
 providing custom glyphs for notation elements.  A simple example is
@@ -37,7 +37,7 @@ GROB.  The dimensions of the stencil is not affected.
            (subject-dim-x (ly:stencil-extent subject 0))
            (subject-dim-y (ly:stencil-extent subject 1)))
 
-        ; add parens
+        ;; add parens
         (set! subject
             (ly:stencil-combine-at-edge 
              (ly:stencil-combine-at-edge subject 0 1 pclose 0.2)
@@ -53,13 +53,13 @@ GROB.  The dimensions of the stencil is not affected.
 \relative c' {
     c4 e
 
-    \override NoteHead #'callbacks #'stencil
+    \override NoteHead  #'stencil
     =
     #(parenthesize-callback Note_head::print)
     g bes
-    \revert NoteHead #'callbacks % stencil
+    \revert NoteHead  % stencil
 
-    \override Beam #'callbacks #'stencil
+    \override Beam  #'stencil
     =
     #(parenthesize-callback Beam::print)
 
index 35cb091b2b64d38eea8a355c4fa73f88ca69e97b..cbb48a28198aacd5a2cd3ca56ff3c00e6a49d832 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.7.13"
+\version "2.7.14"
 \header {
 
     texidoc = "The size of every system is correctly determined; this 
@@ -10,7 +10,7 @@
 \layout { 
     \context {
        \Score
-       \override System #'callbacks #'stencil = #box-grob-stencil
+       \override System  #'stencil = #box-grob-stencil
     }
 }
 
index b089e5cb5a3df58720a0c734f1c801b14a41ad29..6eacdf82f7b406f73100b8356ca43d1c9abfa853 100644 (file)
@@ -210,13 +210,13 @@ ADD_INTERFACE (Cluster, "cluster-interface",
 struct Cluster_beacon
 {
 public:
-  DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (height, (SCM));
   static bool has_interface (Grob *);
 };
 
-MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 2);
+MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
 SCM
-Cluster_beacon::height (SCM g, SCM)
+Cluster_beacon::height (SCM g)
 {
   Grob *me = unsmob_grob (g);
   Interval v = robust_scm2interval (me->get_property ("positions"),
@@ -228,4 +228,6 @@ ADD_INTERFACE (Cluster_beacon,
               "cluster-beacon-interface",
               "A place holder for the cluster spanner to determine the vertical "
               "extents of a cluster spanner at this X position.",
-              "positions");
+
+              /* properties */
+              "positions ");
index 4ee9a4300214c5abce9f596753e3991225048335..2fc887300d15cb49acee7e9ebc291e6946e519e4 100644 (file)
@@ -136,7 +136,9 @@ execute_general_pushpop_property (Context *context,
       bool ok = true;
       if (!scm_is_pair (scm_cdr (grob_property_path)))
        {
-         ok = type_check_assignment (symbol, new_value, ly_symbol2scm ("backend-type?"));
+         ok = !ly_is_procedure (new_value)
+           && type_check_assignment (symbol, new_value,
+                                     ly_symbol2scm ("backend-type?"));
 
          /*
            tack onto alist.  We can use set_car, since
index 7a21e66111a5d4285428480fe70806426c17ec10..789b1e45b456636810c33cbadae84791b12b3e4a 100644 (file)
@@ -88,7 +88,8 @@ Grob::internal_set_property (SCM sym, SCM v)
 
   if (do_internal_type_checking_global)
     {
-      if (!type_check_assignment (sym, v, ly_symbol2scm ("backend-type?")))
+      if (!ly_is_procedure (v)
+         && !type_check_assignment (sym, v, ly_symbol2scm ("backend-type?")))
        abort ();
       check_interfaces_for_property (this, sym);
     }
@@ -119,7 +120,9 @@ Grob::get_property_data (SCM sym) const
 
   if (do_internal_type_checking_global && scm_is_pair (handle))
     {
-      if (!type_check_assignment (sym, scm_cdr (handle),
+      SCM val = scm_cdr (handle);
+      if (!ly_is_procedure (val)
+         && !type_check_assignment (sym, val, 
                                  ly_symbol2scm ("backend-type?")))
        abort ();
 
index e8911d6a6bee3e5c55eb118920b92d7d853b1958..e806689a42a08622d75fdf2a134f3571ac21d7b6 100644 (file)
@@ -38,7 +38,8 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
-  if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
+  if (!ly_is_procedure (val)
+      && !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
     error ("typecheck failed");
 
   sc->internal_set_property (sym, val);
@@ -48,7 +49,7 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
 LY_DEFINE (ly_grob_property, "ly:grob-property",
           2, 0, 0, (SCM grob, SCM sym),
           "Return the value of a value in grob @var{g} of property @var{sym}. "
-          "It will return @code{' ()} (end-of-list) "
+          "It will return @code{'()} (end-of-list) "
           "if  @var{sym} is undefined in @var{g}."
           "\n\n")
 {
index 92436d5a7ddbc29435745556a178100c4389673d..1423a30e370ae487aa9942ba12ede876df878a31 100644 (file)
@@ -2615,3 +2615,13 @@ def conv (str):
 
 conversions.append (((2, 7, 13), conv,
                     '''layout engine refactoring. [FIXME] '''))
+
+
+
+def conv (str):
+       str = re.sub (r"#'callbacks", '', str)
+       str = re.sub (r"([XY]-extent)-callback", r'\1', str)
+       return str
+
+conversions.append (((2, 7, 14), conv,
+                    '''Remove callbacks property, deprecate XY-extent-callback. '''))
index a3d4df37e0c86b668d38300eb2bd53e1c70873a3..061ea4d83dde952fd9f871a81e9770a4489bd361 100644 (file)
@@ -48,7 +48,7 @@
 (ly:add-interface
  'ligature-bracket-interface
  "A bracket indicating a ligature in the original edition"
- '(width thickness height ligature-primitive-callback))
+ '(width thickness height))
 
 
 (ly:add-interface
index 2024bd034fab9848049bda6a428bf26734382119..1bb9fbc34916c3270905a2fc6f7ca452b7e59d69 100644 (file)
@@ -22,7 +22,10 @@ if not os.path.isdir (datadir):
 if os.environ.has_key ('LILYPONDPREFIX'):
        datadir = os.environ['LILYPONDPREFIX']
        while datadir[-1] == os.sep:
-               datadir= datadir[:-1]
+               datadir = datadir[:-1]
+
+if os.path.exists (os.path.join (datadir, 'share/lilypond/@TOPLEVEL_VERSION@/')):
+       datadir = os.path.join (datadir, 'share/lilypond/@TOPLEVEL_VERSION@/')
 
 sys.path.insert (0, os.path.join (datadir, 'python'))