kludge rehearsalmark placement.
* lily/grob-scheme.cc (LY_DEFINE): add ly:item-break-dir , ly:item?
, ly:spanner?
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.
{
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");
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 ());
+}
+
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());
}
ambitus
breathing-sign
clef
+ rehearsal-mark
staff-bar
key-signature
time-signature
. (
(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
. (
) )
+
+(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)
+ ))