]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/ligature-engraver.hh
fe3bcb052d929390dd27c975bdf9206f76074a5c
[lilypond.git] / lily / include / ligature-engraver.hh
1 /*
2   ligature-engraver.hh -- declare Ligature_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
7 */
8 #ifndef LIGATURE_ENGRAVER_HH
9 #define LIGATURE_ENGRAVER_HH
10
11 #include "engraver.hh"
12
13 /*
14  * FIXME: Spanner *create_ligature_spanner () and virtual void
15  * typeset_ligature (...) are abstract methods, such that we would
16  * like to declare them abstract:
17  *
18  *    virtual Spanner *create_ligature_spanner () = 0;
19  *    virtual void typeset_ligature (...) = 0;
20  *
21  * Unfortunately, clone_const_helper() (as expanded from the
22  * TRANSLATOR_DECLARATIONS macro) requires this class to be
23  * instantiatable, such that it may not have any abstract virtual
24  * functions.  As a workaround, the actually abstract methods are
25  * implemented, but produce a programming_error whenever called. --jr
26  */
27
28 class Ligature_engraver : public Engraver
29 {
30 protected:
31   virtual void stop_translation_timestep ();
32   virtual void finalize ();
33
34   virtual void acknowledge_grob (Grob_info);
35   virtual bool try_music (Music *);
36   virtual void process_music ();
37   virtual Spanner *create_ligature_spanner (); /* abstract method */
38   virtual void typeset_ligature (Spanner *ligature,
39                                  Array<Grob_info> primitives); /* abstract method */
40   virtual Spanner *current_ligature ();
41   SCM brew_ligature_primitive_proc;
42
43 public:
44   TRANSLATOR_DECLARATIONS (Ligature_engraver);
45
46 private:
47   Drul_array<Music *> reqs_drul_;
48
49   Spanner *ligature_;
50   Array<Grob_info> primitives_;
51
52   Spanner *finished_ligature_;
53   Array<Grob_info> finished_primitives_;
54
55   Music *prev_start_req_;
56
57   // moment where ligature started.
58   Moment ligature_start_mom_;
59
60   Grob *last_bound_;
61
62   void override_stencil_callback ();
63   void revert_stencil_callback ();
64 };
65
66 #endif // LIGATURE_ENGRAVER_HH