]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/output-lib.scm (shift-right-at-line-begin): new function:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Jan 2004 13:14:28 +0000 (13:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Jan 2004 13:14:28 +0000 (13:14 +0000)
kludge rehearsalmark placement.

* lily/grob-scheme.cc (LY_DEFINE): add ly:item-break-dir , ly:item?
, ly:spanner?

ChangeLog
lily/break-align-engraver.cc
lily/grob-scheme.cc
lily/mark-engraver.cc
ly/engraver-init.ly
scm/define-grobs.scm
scm/output-lib.scm

index f1af5ba50129d23932534fa45e96ce9ee693be45..7b6ea7d5edc17bb8d63c60935146938da5143280 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2004-01-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * scm/output-lib.scm (shift-right-at-line-begin): new function:
+       kludge rehearsalmark placement.
+
+       * lily/grob-scheme.cc (LY_DEFINE): add ly:item-break-dir , ly:item?
+       , ly:spanner?
+
+       * lily/note-head.cc (internal_brew_molecule): only shorten ledger
+       close to note head for accidentals.
+
        * lily/tuplet-bracket.cc (get_default_dir): new algorithm for
        tuplet direction.
 
index 6bb84b639b4e04797b8aedb0109d4b1c368255b9..a797a291550c3997709c19fc46184dec2d7d9e5e 100644 (file)
@@ -93,7 +93,10 @@ Break_align_engraver::acknowledge_grob (Grob_info inf)
 {
   if (Item * item = dynamic_cast <Item *> (inf.grob_))
     {
-      if (item->empty_b (X_AXIS) || item->get_parent (X_AXIS))
+      /*
+       Removed check for item->empty (X_AXIS). --hwn 20/1/04
+       */
+      if (item->get_parent (X_AXIS))
        return;
 
       SCM bp=item->get_grob_property ("breakable");
index 70004e9959290f43cfe065c1b9a7ceb1402f7de7..53d2c608f46f578451a89c515a828f2d487e8e09 100644 (file)
@@ -190,3 +190,39 @@ LY_DEFINE (ly_grob_translate_axis_x,
   return SCM_UNDEFINED;
 }
 
+
+
+LY_DEFINE (ly_spanner_p,
+         "ly:spanner?", 1, 0, 0,
+          (SCM g),
+          "Is  @var{g} a spanner object?")
+{
+  Grob *me = unsmob_grob (g);
+  bool b = dynamic_cast<Spanner*> (me);
+
+  return gh_bool2scm (b);
+}
+
+LY_DEFINE (ly_item_p,
+         "ly:item?", 1, 0, 0,
+          (SCM g),
+          "Is  @var{g} a item object?")
+{
+  Grob *me = unsmob_grob (g);
+  bool b = dynamic_cast<Item*> (me);
+
+  return gh_bool2scm (b);
+}
+
+
+LY_DEFINE (ly_item_break_dir,
+         "ly:item-break-dir", 1, 0, 0,
+          (SCM it),
+          "The break status dir of  @var{it}.")
+{
+  Item * me = dynamic_cast<Item*> ( unsmob_grob (it));
+  SCM_ASSERT_TYPE (me, it, SCM_ARG1, __FUNCTION__, "Item");
+  
+   return gh_int2scm (me->break_status_dir ());
+}
+
index 705d96a0e39dc54a7e1235693485b4d5b781cd98..c13d3e60af5fc617a998505e7ba545bc0a632cf9 100644 (file)
@@ -77,13 +77,13 @@ Mark_engraver::stop_translation_timestep ()
 
 
 void
-Mark_engraver::create_items (Music *rq)
+Mark_engraver::create_items (Music *ev)
 {
   if (text_)
     return;
 
   text_ = new Item (get_property ("RehearsalMark"));
-  announce_grob(text_, rq->self_scm());
+  announce_grob(text_, ev->self_scm());
 }
 
 
index 8b13c41ebd53d2a1d1512a50d552e2694bb720fc..2ee75e707813f879c352db07dbbeaec68b80c5bb 100644 (file)
@@ -496,6 +496,7 @@ AncientRemoveEmptyStaffContext = \translator {
          ambitus
          breathing-sign
          clef
+         rehearsal-mark
          staff-bar
          key-signature
          time-signature
index 2e8121993d54d08ce61fd155fae50d96a3e9b012..e1f168011f562814753bce2244e232b885cb48de 100644 (file)
      . (
        (molecule-callback . ,Text_item::brew_molecule)
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
-       (Y-offset-callbacks . (,Side_position_interface::aligned_side)) 
+       (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+       (after-line-breaking-callback . ,shift-right-at-line-begin)
        (self-alignment-X . 0)
        (direction . 1)
        (breakable . #t)
        (baseline-skip . 2)
        (break-visibility . ,end-of-line-invisible)
        (padding . 0.8)
-       (meta . ((interfaces . (break-aligned-interface text-interface side-position-interface font-interface mark-interface self-alignment-interface item-interface ))))
+       (meta . ((interfaces . (text-interface side-position-interface font-interface mark-interface self-alignment-interface item-interface ))))
        ))
      (MetronomeMark
      . (
index 3ca97b267a34989cd5c1fe14e285c7c980f917ff..a305b10eb89b9912623db2d1e478468932512782 100644 (file)
@@ -249,3 +249,9 @@ centered, X==1 is at the right, X == -1 is at the left."
      ) )
      
 
+
+(define-public (shift-right-at-line-begin g)
+  "Shift an item to the right, but only at the start of the line."
+  (if (and (ly:item? g)  (equal? (ly:item-break-dir g) RIGHT))
+      (ly:grob-translate-axis! g 3.5 X)
+  ))