/*
- System-start-delimiter-engraver.cc -- implement
- System_start_delimiter_engraver
+ This file is part of LilyPond, the GNU music typesetter.
- source file of the GNU LilyPond music typesetter
+ Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
- (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#include "engraver.hh"
-
-#include "side-position-interface.hh"
-#include "system-start-delimiter.hh"
-#include "staff-symbol.hh"
-#include "pointer-group-interface.hh"
-#include "paper-column.hh"
#include "output-def.hh"
+#include "paper-column.hh"
+#include "pointer-group-interface.hh"
+#include "side-position-interface.hh"
#include "spanner.hh"
+#include "staff-symbol.hh"
+#include "system-start-delimiter.hh"
struct Bracket_nesting_node
{
public:
- virtual ~Bracket_nesting_node (){}
+ virtual ~Bracket_nesting_node () {}
virtual bool add_staff (Grob *) { return false; }
- virtual void add_support (Grob *) { }
- virtual void set_bound (Direction, Grob *){}
- virtual void set_nesting_support (Grob*) {}
- virtual void create_grobs (Engraver*, SCM) {}
+ virtual void add_support (Grob *) {}
+ virtual void set_bound (Direction, Grob *) {}
+ virtual void set_nesting_support (Grob *) {}
+ virtual void create_grobs (Engraver *, SCM) {}
};
struct Bracket_nesting_group : public Bracket_nesting_node
vector<Bracket_nesting_node*> children_;
SCM symbol_;
- void from_list (SCM );
+ void from_list (SCM);
virtual void add_support (Grob *grob);
virtual bool add_staff (Grob *grob);
- virtual void set_nesting_support (Grob*);
+ virtual void set_nesting_support (Grob *);
virtual void set_bound (Direction, Grob *grob);
- virtual void create_grobs (Engraver*, SCM);
+ virtual void create_grobs (Engraver *, SCM);
~Bracket_nesting_group ();
Bracket_nesting_group ();
};
Bracket_nesting_group::create_grobs (Engraver *engraver, SCM default_type)
{
SCM type = scm_is_symbol (symbol_) ? symbol_ : default_type;
- delimiter_ = engraver->make_spanner (ly_symbol2string (type).c_str (), SCM_EOL);
+ delimiter_ = engraver->make_spanner (ly_symbol2string (type).c_str (),
+ SCM_EOL);
for (vsize i = 0 ; i < children_.size (); i++)
- {
- children_[i]->create_grobs (engraver, default_type);
- }
+ children_[i]->create_grobs (engraver, default_type);
}
void
{
Side_position_interface::add_support (g, delimiter_);
for (vsize i = 0 ; i < children_.size (); i++)
- {
- children_[i]->add_support (g);
- }
+ children_[i]->add_support (g);
}
Bracket_nesting_group::~Bracket_nesting_group ()
{
delimiter_->set_bound (d, g);
for (vsize i = 0 ; i < children_.size (); i++)
- {
- children_[i]->set_bound (d, g);
- }
+ children_[i]->set_bound (d, g);
}
void
{
if (parent)
Side_position_interface::add_support (delimiter_, parent);
-
+
for (vsize i = 0 ; i < children_.size (); i++)
- {
- children_[i]->set_nesting_support (delimiter_);
- }
+ children_[i]->set_nesting_support (delimiter_);
}
else if (entry == ly_symbol2scm ("SystemStartBrace")
|| entry == ly_symbol2scm ("SystemStartBracket")
|| entry == ly_symbol2scm ("SystemStartBar")
- || entry == ly_symbol2scm ("SystemStartSquare")
- )
+ || entry == ly_symbol2scm ("SystemStartSquare"))
symbol_ = entry;
else
- {
- children_.push_back (new Bracket_nesting_staff (0));
- }
+ children_.push_back (new Bracket_nesting_staff (0));
}
}
{
if (children_[i]->add_staff (grob))
{
- Pointer_group_interface::add_grob (delimiter_, ly_symbol2scm ("elements"), grob);
+ Pointer_group_interface::add_grob (delimiter_,
+ ly_symbol2scm ("elements"), grob);
return true;
}
}
-
return false;
}
protected:
Bracket_nesting_group *nesting_;
-
+
DECLARE_ACKNOWLEDGER (system_start_delimiter);
- DECLARE_ACKNOWLEDGER (system_start_text);
DECLARE_ACKNOWLEDGER (staff_symbol);
void process_music ();
nesting_->from_list (hierarchy);
nesting_->create_grobs (this, delimiter_name);
- nesting_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ nesting_->set_bound (LEFT,
+ unsmob_grob (get_property ("currentCommandColumn")));
}
}
}
}
-
-
-void
-System_start_delimiter_engraver::acknowledge_system_start_text (Grob_info inf)
-{
- nesting_->add_support (inf.grob ());
-}
-
void
System_start_delimiter_engraver::acknowledge_system_start_delimiter (Grob_info inf)
{
ADD_ACKNOWLEDGER (System_start_delimiter_engraver, staff_symbol);
ADD_ACKNOWLEDGER (System_start_delimiter_engraver, system_start_delimiter);
-ADD_ACKNOWLEDGER (System_start_delimiter_engraver, system_start_text);
ADD_TRANSLATOR (System_start_delimiter_engraver,
/* doc */