From f6f0c7e718f866de8084e1221cc3e027c831fe35 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 24 Mar 2002 22:07:04 +0100 Subject: [PATCH] partial: 1.5.47.jcn --- lily/include/tuplet-bracket.hh | 38 +++++++++++++++++++ lily/include/tuplet-spanner.hh | 38 +------------------ .../{volta-spanner.hh => volta-bracket.hh} | 7 ++-- lily/{volta-spanner.cc => volta-bracket.cc} | 25 ++++++------ 4 files changed, 55 insertions(+), 53 deletions(-) create mode 100644 lily/include/tuplet-bracket.hh rename lily/include/{volta-spanner.hh => volta-bracket.hh} (92%) rename lily/{volta-spanner.cc => volta-bracket.cc} (85%) diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh new file mode 100644 index 0000000000..b50780aba6 --- /dev/null +++ b/lily/include/tuplet-bracket.hh @@ -0,0 +1,38 @@ + +/* + tuplet-bracket.hh -- part of GNU LilyPond + + (c) 1997--2002 Jan Nieuwenhuizen +*/ + +#ifndef Tuplet_bracket_HH +#define Tuplet_bracket_HH + +#include "lily-guile.hh" + +/* + + TODO: quantise, we don't want to collide with staff lines. + (or should we be above staff?) + + todo: handle breaking elegantly. +*/ +class Tuplet_bracket +{ +public: + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + static bool has_interface (Grob*); + + static void add_column (Grob*me,Item*); + static void add_beam (Grob*me,Grob*); + + static void calc_dy (Grob*,Real *) ; + static void calc_position_and_height (Grob*,Real*,Real *dy); + + DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); + + static Direction get_default_dir (Grob*); +}; + +#endif // Tuplet_bracket_HH + diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh index 661bd3aaa4..65296f8106 100644 --- a/lily/include/tuplet-spanner.hh +++ b/lily/include/tuplet-spanner.hh @@ -1,38 +1,2 @@ -/* - plet-spanner.hh -- part of GNU LilyPond - - (c) 1997--2002 Jan Nieuwenhuizen -*/ - -#ifndef Tuplet_bracket_HH -#define Tuplet_bracket_HH - -#include "lily-guile.hh" - -/* - - TODO: quantise, we don't want to collide with staff lines. - (or should we be above staff?) - - todo: handle breaking elegantly. -*/ -class Tuplet_bracket -{ -public: - DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); - static void set_interface (Grob*); - static bool has_interface (Grob*); - - static void add_column (Grob*me,Item*); - static void add_beam (Grob*me,Grob*); - - static void calc_dy (Grob*,Real *) ; - static void calc_position_and_height (Grob*,Real*,Real *dy); - - DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); - - static Direction get_default_dir (Grob*); -}; - -#endif // Tuplet_bracket_HH +#error diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-bracket.hh similarity index 92% rename from lily/include/volta-spanner.hh rename to lily/include/volta-bracket.hh index 874a62f258..fda29658e8 100644 --- a/lily/include/volta-spanner.hh +++ b/lily/include/volta-bracket.hh @@ -1,3 +1,4 @@ + /* volta-spanner.hh -- part of GNU LilyPond @@ -10,14 +11,12 @@ #include "spanner.hh" -/** -*/ - -class Volta_spanner +class Volta_bracket_interface { public: static void set_interface (Grob*); static bool has_interface (Grob*); + DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); static void add_column (Grob*, Grob*col); static void add_bar (Grob*me, Item*bar); diff --git a/lily/volta-spanner.cc b/lily/volta-bracket.cc similarity index 85% rename from lily/volta-spanner.cc rename to lily/volta-bracket.cc index 8b3faa777b..1705fbf24b 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-bracket.cc @@ -1,5 +1,5 @@ /* - volta-spanner.cc -- implement Volta_spanner + volta-bracket.cc -- implement Volta_bracket_interface source file of the GNU LilyPond music typesetter @@ -15,17 +15,12 @@ #include "paper-column.hh" #include "paper-def.hh" #include "text-item.hh" -#include "volta-spanner.hh" +#include "volta-bracket.hh" #include "group-interface.hh" #include "side-position-interface.hh" #include "directional-element-interface.hh" -void -Volta_spanner::set_interface (Grob*) -{ -} - /* this is too complicated. Yet another version of side-positioning, badly implemented. @@ -36,9 +31,9 @@ Volta_spanner::set_interface (Grob*) */ -MAKE_SCHEME_CALLBACK (Volta_spanner,brew_molecule,1); +MAKE_SCHEME_CALLBACK (Volta_bracket_interface,brew_molecule,1); SCM -Volta_spanner::brew_molecule (SCM smob) +Volta_bracket_interface::brew_molecule (SCM smob) { Grob *me = unsmob_grob (smob); Link_array bar_arr @@ -104,7 +99,8 @@ Volta_spanner::brew_molecule (SCM smob) Box b (Interval (0, w), Interval (0, h)); Molecule mol (b, at); SCM text = me->get_grob_property ("text"); - SCM properties = scm_list_n (me->mutable_property_alist_, me->immutable_property_alist_,SCM_UNDEFINED); + SCM properties = scm_list_n (me->mutable_property_alist_, + me->immutable_property_alist_,SCM_UNDEFINED); Molecule num = Text_item::text2molecule (me, text, properties); mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length () @@ -115,7 +111,7 @@ Volta_spanner::brew_molecule (SCM smob) void -Volta_spanner::add_bar (Grob *me, Item* b) +Volta_bracket_interface::add_bar (Grob *me, Item* b) { Pointer_group_interface::add_grob (me, ly_symbol2scm ("bars"), b); Side_position_interface::add_support (me,b); @@ -123,7 +119,12 @@ Volta_spanner::add_bar (Grob *me, Item* b) } void -Volta_spanner::add_column (Grob*me, Grob* c) +Volta_bracket_interface::add_column (Grob*me, Grob* c) { Side_position_interface::add_support (me,c); } + +ADD_INTERFACE (Volta_bracket_interface,"volta-bracket-interface", + "Volta bracket with number", + "bars thickness height"); + -- 2.39.2