]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/engraver-group.hh
New upstream version 2.19.65
[lilypond.git] / lily / include / engraver-group.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef ENGRAVER_GROUP_HH
21 #define ENGRAVER_GROUP_HH
22
23 #include "engraver.hh"
24 #include "translator-group.hh"
25
26 class Announce_grob_info : public Grob_info
27 {
28   Direction start_end_;
29 public:
30   Announce_grob_info (Grob_info gi, Direction start_end)
31     : Grob_info (gi), start_end_ (start_end)
32   { }
33   Direction start_end () const { return start_end_; }
34 };
35
36 struct Preinit_Engraver_group
37 {
38   Drul_array<SCM> acknowledge_hash_table_drul_;
39   Preinit_Engraver_group ();
40 };
41
42 class Engraver_group : Preinit_Engraver_group, public Translator_group
43 {
44 protected:
45   vector<Announce_grob_info> announce_infos_;
46   void override (SCM);
47   void revert (SCM);
48 public:
49   DECLARE_CLASSNAME (Engraver_group);
50   Engraver_group ();
51   virtual void derived_mark () const;
52   void do_announces ();
53   virtual void connect_to_context (Context *c);
54   virtual void disconnect_from_context ();
55   virtual void announce_grob (Grob_info, Direction start_end,
56                               Context *reroute_context = 0);
57   bool pending_grobs () const;
58 private:
59   virtual void acknowledge_grobs ();
60 };
61
62 typedef void (Engraver:: *Engraver_method) (void);
63
64 void engraver_each (SCM list, Engraver_method method);
65
66 #endif /* ENGRAVERGROUP_HH */
67