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