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